home *** CD-ROM | disk | FTP | other *** search
/ Run Magazine ReRun: Strategy Games 2 / rerun-strategygamesII.d64 / yatzy (.txt) < prev   
Commodore BASIC  |  2022-09-20  |  9KB  |  296 lines

  1. 2 printchr$(147)"would you like instructions (y/n)?
  2. 4 [161] a$: [139] a$[179][177] "y" [175] a$[179][177]"n" [167] 4
  3. 6 [139] a$[178]"n" [167] 88
  4. 8 [153]"instructions on screen or printer (s/p)?
  5. 10 get b$: if b$<> "s" and b$<>"p" then 10
  6. 12 if b$="s"then  d=3
  7. 14 if b$="p" then d=4
  8. 16 open d,d
  9. 18 print#d,"
  10. 20 [152]d,"yatzy by robert cook
  11. 22 print#d,"run it right: c-64; joystick
  12. 24 [152]d,"
  13. 26 print#d,"in this 4 player game, you get three
  14. 28 [152]d,"rolls of the dice to make a hand.
  15. 30 print#d,"using a joystick in port 2, point the
  16. 32 [152]d,"hand at each die you want to reroll
  17. 34 print#d,"then fire. when you're ready, point
  18. 36 [152]d,"at "[199](34)"roll"[199](34)" and press fire again.
  19. 38 print#d,"cancel your selections with "chr$(34)"undo"chr$(34)". if
  20. 40 [152]d,"you like the first or second roll, just
  21. 42 print#d,"roll again.
  22. 44 [152]d,"
  23. 46 print#d,"the upper score area lists the numbers
  24. 48 [152]d,"on a die. the lower lists poker hands.
  25. 50 print#d,"above, a score is the number listed
  26. 52 [152]d,"times its frequency in the roll, and
  27. 54 print#d,"there's a bonus for totals of 63 or
  28. 56 [152]d,"more. below, a full house, small and
  29. 58 print#d,"large straights, and yatzy earn fixed
  30. 60 [152]d,"scores. three and four of a kind and
  31. 62 print#d,"chance (a catch-all) total all five
  32. 64 [152]d,"dice.":[139] d[178]4 [167] 74
  33. 66 [153]"press any key to continue"
  34. 68 [161] dd$:[139] dd$[178]"" [167] 68
  35. 70 [152]d,"
  36. 72 print#d,"
  37. 74 [152]d,"
  38. 76 print#d,"each turn, choose the unused category
  39. 78 [152]d,"that will score the most. if you use
  40. 80 print#d,"an inappropriate category, you score
  41. 82 [152]d,"zero. play ends when everyone has used
  42. 84 print#d,"all categories.
  43. 86 [152]d,"":[160]d
  44. 88 [153]"press any key to begin the program..."
  45. 90 [161] e$:[139] e$[178]"" [167] 90
  46. 92 [156]
  47. 94 [143] yatzy - robert b. cook
  48. 96 [141]376:[141]408:[141]322
  49. 98 [141]110:[141]170
  50. 100 [141]198:[141]282
  51. 102 c1[178]c1[170]1:[139]c1[178]np[172]13[167]310
  52. 104 pl[178]pl[170]1:[139]pl[177]np[167]pl[178]1
  53. 106 [137]98
  54. 108 [178] start [178]
  55. 110 [153]"waitstop"[163]58)[200]("sgnstop#1 sgnstop#2 sgnstop#3 sgnstop#4 int",np[172]6[170]2)
  56. 112 [153]""[163]54[170]pl[172]4)" #"[202]([196](pl),2)" waitsgn"
  57. 114 rl[178]1:[153]dn$[163]36)"on"rn$(1)
  58. 116 [129]l1[178]1[164]5:[151]2040[170]l1,200:di(l1)[178]0:[130]:[151]sp[170]21,62
  59. 118 [141]126:[139]rl[178]4[167][142]
  60. 120 [141]150:[139]rd[177]0[167]118
  61. 122 [142]
  62. 124 [178] roll dice [178]
  63. 126 [129]l1[178]1[164]5
  64. 128 [139]di(l1)[178]0[167]dn(l1)[178][181]([187](1)[172]6[170]1)
  65. 130 [130]
  66. 132 [129]l1[178]1[164]5:[139]di(l1)[178]1[167]142
  67. 134 t1[178][181]([187](1)[172]6[170]1)
  68. 136 [151]wv,129:[151]lf,85:[151]hf,36
  69. 138 [151]2040[170]l1,192[170]t1:[129]l2[178]1[164]25:[130]:[151]wv,128
  70. 140 di(l1)[178]1:[139]t1[179][177]dn(l1)[167]134
  71. 142 [130]
  72. 144 rl[178]rl[170]1:[139]rl[179]4[167][153]dn$[163]36)"on"rn$(rl)
  73. 146 [142]
  74. 148 [178] choose dice [178]
  75. 150 [151]sp[170]1,92:[151]sp[170]21,63:rd[178]0:t1[178]1
  76. 152 js[178][194](56320)[175]31:[139]js[178]31[167]152
  77. 154 [139]js[178]15[175]t1[178]0[167][129]l1[178]1[164]5:[151]2040[170]l1,192[170]dn(l1):di(l1)[178]1:[130]:rd[178]0
  78. 156 [139]js[178]15[175]t1[178]6[167]166
  79. 158 [139]js[178]15[175]t1[177]0[167][151]2040[170]t1,200:rd[178]rd[170]1:di(t1)[178]0
  80. 160 [139]js[178]29[167]t1[178]t1[170]1:[139]t1[177]6[167]t1[178]6
  81. 162 [139]js[178]30[167]t1[178]t1[171]1:[139]t1[179]0[167]t1[178]0
  82. 164 [151]sp[170]1,68[170]24[172]t1:[129]l1[178]1[164]99:[130]:[137]152
  83. 166 [146]56320,16,15:[142]
  84. 168 [178] choose line [178]
  85. 170 [151]sp[170]21,254
  86. 172 ln[178]1:[151]sp[170]15,86
  87. 174 js[178][194](56320)[175]31:[139]js[178]31[167]174
  88. 176 [139]js[178]15[175]mx(pl,ln)[178]0[167][142]
  89. 178 [139]js[178]15[167][141]304
  90. 180 [129]l1[178]1[164]99:[130]:[139]js[178]30[167]190
  91. 182 [139]js[179][177]29[167]174
  92. 184 ln[178]ln[170]1:[139]ln[178]7[167]ln[178]11
  93. 186 [139]ln[177]17[167]ln[178]1
  94. 188 [137]194
  95. 190 ln[178]ln[171]1:[139]ln[178]10[167]ln[178]6
  96. 192 [139]ln[179]1[167]ln[178]17
  97. 194 [151]sp[170]15,78[170]ln[172]8:[137]174
  98. 196 [178] calculate [178]
  99. 198 sc[178]0:mx(pl,ln)[178]1
  100. 200 [145][171](ln[179]7)[137]204:[137]218
  101. 202 [178] upper [178]
  102. 204 [129]l1[178]1[164]5
  103. 206 [139]dn(l1)[178]ln[167]sc[178]sc[170]ln
  104. 208 [130]
  105. 210 sc(pl,1)[178]sc(pl,1)[170]sc:[139]sc(pl,1)[177]62[167]sc(pl,2)[178]35
  106. 212 sc(pl,3)[178]sc(pl,1)[170]sc(pl,2):sc(pl,5)[178]sc(pl,3)[170]sc(pl,4)
  107. 214 [142]
  108. 216 [178] lower [178]
  109. 218 t1[178]0:t2[178]0:sc[178]0
  110. 220 [129]l1[178]1[164]6:ct(l1)[178]0:[130]
  111. 222 [129]l1[178]1[164]5:t2[178]t2[170]dn(l1):[129]l2[178]1[164]6
  112. 224 [139]dn(l1)[178]l2[167]ct(l2)[178]ct(l2)[170]1
  113. 226 [130]:[130]
  114. 228 [145]ln[171]10[141]236,236,246,258,258,270,278
  115. 230 sc(pl,4)[178]sc(pl,4)[170]sc:sc(pl,5)[178]sc(pl,3)[170]sc(pl,4)
  116. 232 [142]
  117. 234 [172] 3 [176] 4 of a kind [172]
  118. 236 [129]l1[178]1[164]6
  119. 238 [139]ln[178]11[175]ct(l1)[177]2[167]sc[178]t2
  120. 240 [139]ln[178]12[175]ct(l1)[177]3[167]sc[178]t2
  121. 242 [130]:[142]
  122. 244 [172] full house [172]
  123. 246 [129]l1[178]1[164]6
  124. 248 [139]ct(l1)[178]2[167]t1[178]t1[170]2
  125. 250 [139]ct(l1)[178]3[167]t1[178]t1[170]3
  126. 252 [139]t1[178]5[167]sc[178]25
  127. 254 [130]:[142]
  128. 256 [172] small straight [176] large straight [172]
  129. 258 [129]l1[178]1[164]6
  130. 260 t1[178]t1[170]1:[139]ct(l1)[178]0[167]t1[178]0
  131. 262 [139]ln[178]14[175]t1[178]4[167]sc[178]30
  132. 264 [139]ln[178]15[175]t1[178]5[167]sc[178]40
  133. 266 [130]:[142]
  134. 268 [172] yatzy [172]
  135. 270 [129]l1[178]1[164]6
  136. 272 [139]ct(l1)[178]5[167]sc[178]50
  137. 274 [130]:[142]
  138. 276 [172] chance [172]
  139. 278 sc[178]t2:[142]
  140. 280 [178] [153] [178]
  141. 282 [151]646,0:[139]ln[178]16[167][151]646,4
  142. 284 [153][200](dn$,ln[170]4)[163]19[170](4[172](pl[171]1)))[201](" "[170][196](sc),3)
  143. 286 [141]298
  144. 288 [129]l[178]1[164]5:t[178][197]([202]("01112132224",l[172]2,2))
  145. 290 [151]646,1:[139]l[178]2[167][151]646,2
  146. 292 [153][200](dn$,t)[163]19[170](4[172](pl[171]1)))[201](" "[170][196](sc(pl,l)),3)
  147. 294 [130]:[151]sp[170]21,62:[142]
  148. 296 [178] blip [178]
  149. 298 [151]sr,240:[151]wv,17:[151]hf,50:[151]lf,35
  150. 300 [129]l1[178]1[164]99:[130]:[151]wv,16:[151]sr,0:[142]
  151. 302 [178] buzz [178]
  152. 304 [151]sr,240:[151]wv,33:[151]hf,5
  153. 306 [129]l1[178]1[164]150:[130]:[151]wv,32:[142]
  154. 308 [178] [128] game [178]
  155. 310 [151]sp[170]21,0:[151]829,234
  156. 312 [153]" press  fire "
  157. 314 [129]l1[178]1[164]np:hs[178]sc(l1,5):[139]hs[179][178][194](829[170]l1[172]2)[172]256[170][194](830[170]l1[172]2)[167]318
  158. 316 [151]829[170]l1[172]2,hs[173]256:[151]830[170]l1[172]2,(hs[173]256[171][181](hs[173]256))[172]256
  159. 318 [130]:[146]56320,16,16:[146]56320,16,15:[138]
  160. 320 [178] screen [178]
  161. 322 [153]"loadabs ortan^ortan^ortan^ortan^ortan^ wait(NULL)usrusrusr(NULL)usrusrusr(NULL)usrusrusr(NULL)usrusrusrintsys    "
  162. 324 [153]"abs (NULL)y(NULL)(NULL)a(NULL)(NULL)t(NULL)(NULL)z(NULL)(NULL)y(NULL) waitsgn   sgn   sgn   sgn   intsys    "
  163. 326 [153]"abs /tanexp/tanexp/tanexp/tanexp/tanexp wait(NULL)andandand(NULL)andandand(NULL)andandand(NULL)andandandintsysundo"
  164. 328 [153]"abscont high score      waitfn   fn   fn   fn   intsysusrusrusrusr
  165. 330 print"[182][144]aces........[165][144]add [165]   [165]   [165]   [165]   [181]
  166. 332 [153]"absstopdeuces......fnstopadd fn   fn   fn   fn   int
  167. 334 print"[182][144]threes......[165][144]add [165]   [165]   [165]   [165]   [181]
  168. 336 [153]"absstopfours.......fnstopadd fn   fn   fn   fn   int
  169. 338 print"[182][144]fives.......[165][144]add [165]   [165]   [165]   [165]   [181]
  170. 340 [153]"absstopsixes.......fnstopadd fn   fn   fn   fn   int
  171. 342 print"[182] sub total       [146][165]   [165]   [165]   [165]   [181]
  172. 344 [153]"abs bonus (63) waitfn=35 fn   fn   fn   fn   int
  173. 346 print"[182] total upper     [146][165]   [165]   [165]   [165]   [181]
  174. 348 [153]"absusrusrusrusrusrusrusrusrusrusrusrusr(NULL)usrusrusrusr(NULL)usrusrusr(NULL)usrusrusr(NULL)usrusrusr(NULL)usrusrusrint
  175. 350 print"[182][144]3 of a kind.[165][144]add [165]   [165]   [165]   [165]   [181]
  176. 352 [153]"absstop4 of a kind.fnstopadd fn   fn   fn   fn   int
  177. 354 print"[182][144]full house..[165][144]=25 [165]   [165]   [165]   [165]   [181]
  178. 356 [153]"absstopsm straight.fnstop=30 fn   fn   fn   fnclose  int
  179. 358 print"[182][144]lg straight.[165][144]=40 [165]   [165]   [165]   [165]   [181]
  180. 360 [153]"absclryatzy       waitfnclr=50 fn   fn   fn   fn   intforandanda