home *** CD-ROM | disk | FTP | other *** search
/ Run Magazine ReRun: Strategy Games 2 / rerun-strategygamesII.d64 / cards-31 (.txt) next >
Commodore BASIC  |  2022-09-20  |  7KB  |  223 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] 84
  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,"cards-31 by john fedor
  11. 22 print#d,"
  12. 24 [152]d,"run it right: c-64
  13. 26 print#d,"
  14. 28 [152]d,"cards-31 is an adaptation of knock, a
  15. 30 print#d,"game where you can win nickels by
  16. 32 [152]d,"scoring close to 31 with cards of one
  17. 34 print#d,"suit. here the pot holds $5 bills. you
  18. 36 [152]d,"and up to 4 computer opponents each
  19. 38 print#d,"start with three cards and $15. number
  20. 40 [152]d,"cards are worth face-value, face cards
  21. 42 print#d,"are worth 10 and aces 11.
  22. 44 [152]d,"
  23. 46 print#d,"you have four options: draw a card from
  24. 48 [152]d,"the deck; draw the top card from the
  25. 50 print#d,"discard pile. if you think you're
  26. 52 [152]d,"closer to 31 than your opponents, ask
  27. 54 print#d,"the computer for advice or knock. when
  28. 56 [152]d,"you draw, you must also discard.":[139] d[178]4 [167] 64
  29. 58 [152]d,"
  30. 60 print"press a key to continue"
  31. 62 get dd$:if dd$="" then 62
  32. 64 print#d,"
  33. 66 [152]d,"
  34. 68 print#d,"
  35. 70 [152]d,"after you knock, each player gets one
  36. 72 print#d,"more turn, then scores are computed.
  37. 74 [152]d,"your score is the highest total in one
  38. 76 print#d,"suit. losers give $5 to the pot, and
  39. 78 [152]d,"a game continues until only one player
  40. 80 print#d,"has  money left and wins the pot.
  41. 82 [152]d,"":[160]d
  42. 84 [153]"press any key to begin the program..."
  43. 86 [161] e$:[139] e$[178]"" [167] 86
  44. 88 [156]
  45. 90 [143] cards 31 - john fedor
  46. 92 [156]:[134] p$(5),d(52),h(5,4),q(3),c$(13),s$(4),ca(5),mo(5),sc(4),t(4),te(5)
  47. 94 [151]53280,11:[151]53281,12
  48. 96 [153]"loadcards-31"
  49. 98 [153]"programmed by john fedor"
  50. 100 [153]"how many opponents would you like (1-4)?"
  51. 102 [153]"(press <d> if you would like to watch.)"
  52. 104 [151]198,0:pl$[178]"d":p$(1)[178]"observer"
  53. 106 [161]a$:[139](a$[179]"1"[176]a$[177]"4")[175]a$[179][177]"d"[167]106
  54. 108 [139]a$[178]"d"[167]op[178]5:mo(1)[178]0:[137]120
  55. 110 [153]"loadyou will play against "a$" opponent";:op[178][197](a$)[170]1:pl$[178]""
  56. 112 a$[178]"s.":[139]op[178]2[167]a$[178]"."
  57. 114 [153]a$
  58. 116 [153]"what shall i call you ";
  59. 118 [133]p$(1):p$(1)[178][200](p$(1),12):[129]i[178]1[164]5:mo(i)[178]0:[130]i:mo(1)[178]15:ca(1)[178]27
  60. 120 [129]i[178]2[164] op:mo(i)[178]15
  61. 122 [135]p$(i),ca(i):[139]p$(i)[178]p$(1)[167]122
  62. 124 [130]i:tu[178]0
  63. 126 [131] fred,30,ted,29,alfred,28,ernest,27,bertram,25
  64. 128 [143] start again here
  65. 130 [153]"loadthe players are:":kn[178]0
  66. 132 [129]i[178]1[164]op:[153]p$(i)[163]15)"$"mo(i):[130]
  67. 134 [153]"pot:"[163]15)"$";
  68. 136 m[178]op[172]15:[129]i[178]1[164]op:m[178]m[171]mo(i):[130]i:[139]p$(1)[178]"observer"[167]m[178]m[171]15
  69. 138 [153]m
  70. 140 [153]"shuffling deck.........................";
  71. 142 [129]y[178]0[164]3:[129]x[178]1[164]13:d(y[172]13[170]x)[178]y[172]100[170]x:[130]x:[153]"cmd cmd";:[130]y
  72. 144 [129]x[178]1[164]21:[129]y[178]1[164]7
  73. 146 z1[178][181]([187](1)[172]52)[170]1:z2[178][181]([187](1)[172]52)[170]1
  74. 148 z3[178]d(z1):d(z1)[178]d(z2):d(z2)[178]z3
  75. 150 [130]y:[153]"cmd cmd";:[130]x:[153]
  76. 152 [153]"dealing..."
  77. 154 dp[178]1:[143] deck pointer
  78. 156 [129]i[178]1[164] 3
  79. 158 [129]z[178]1[164] op
  80. 160 [139] mo(z)[178]0[167]164
  81. 162 h(z,i)[178]d(dp):dp[178]dp[170]1
  82. 164 [130]z,i
  83. 166 di[178]d(dp):dp[178]dp[170]1:[143] discard pile
  84. 168 [129]i[178]1[164]3:q(i)[178]h(1,i):[130]:[143] for print routine
  85. 170 tu[178]tu[170]1:[139]tu[177]op[167]tu[178]1
  86. 172 [139] dp[177]52[167][153]"loadno more cards in the deck.":[137]288
  87. 174 [139] kn[179][177]0 [167] kn[178]kn[171]1:[139] kn[178]0 [167][153]"loadlast round completed.":[137]288
  88. 176 [139] mo(tu)[178]0[167]168
  89. 178 [153]"loadyour hand:"
  90. 180 [139] mo(1)[178]0 [167][153]""[163]13)"not availableonononon":[137]184
  91. 182 [141]  350
  92. 184 [153]"":[153]"discard pile:":q(1)[178]di:q(2)[178]0:q(3)[178]0:[141]350
  93. 186 [139]tu[177]1[167]256
  94. 188 [153]"what would you like to do?"
  95. 190 [153]"1) pick from deck"
  96. 192 [153]"2) pick from discard pile"
  97. 194 [153]"3) knock"
  98. 196 [153]"4) ask for advice";:[151]198,0
  99. 198 [161]a$:[139]a$[179]"1"[176]a$[177]"4"[167]198
  100. 200 [139]a$[178]"3"[175]kn[179][177]0[167]198
  101. 202 [139]a$[178]"3"[167] kn[178]op:[153]"knocking...";:[129]i[178]1[164]5000:[130]:[137]168
  102. 204 [139]a$[178]"4"[167]226
  103. 206 [139]a$[178]"1"[167]di[178]d(dp):dp[178]dp[170]1
  104. 208 [153]"load"[163]8)"(1)"[163]18)"(2)"[163]28)"(3)"
  105. 210 [129]i[178]1[164]3:q(i)[178]h(1,i):[130]:[141]350
  106. 212 [153]""[163]18)"(4)"
  107. 214 q(1)[178]0:q(2)[178]di:q(3)[178]0:[141]350
  108. 216 [153]"which one would you like to discard?"
  109. 218 [151]198,0
  110. 220 [161]a$:[139]a$[179]"1"[176]a$[177]"4"[167]220
  111. 222 [139]a$[179][177]"4"[167]a[178]di:di[178]h(1,[197](a$)):h(1,[197](a$))[178]a
  112. 224 [137]168
  113. 226 [143] give advice
  114. 228 k1[178]31[171]op[172]2[171]2[172](i[178]4)[171]4[172](i[178]5)
  115. 230 [143] check to see for discard
  116. 232 h(1,4)[178]di
  117. 234 [129]i[178]1[164]4:sc(i)[178]h(1,i):[130]
  118. 236 [141]386
  119. 238 [139]dr[178]4[167]242
  120. 240 [153]"loadif i were you, i would pick up from the discard pile.":[137]248
  121. 242 [139] kn[179][177]0[167]246
  122. 244 [139]sc[177][178]k1[167][153]"loadit would seem logical to knock at this  time.":[137]248
  123. 246 [153]"loadyou might as well take a chance and picka card from the deck."
  124. 248 [153]"press <return> to continue."
  125. 250 [151]198,0
  126. 252 [161]a$:[139]a$[179][177][199](13)[167]252
  127. 254 tu[178]tu[171]1:[137]168
  128. 256 [143]  computer's turn
  129. 258 k1[178]ca(tu)
  130. 260 h(tu,4)[178]di
  131. 262 [129]i[178]1[164]4:sc(i)[178]h(tu,i):[130]
  132. 264 [141]386:[153]"";
  133. 266 [139]dr[178]4 [167] 274
  134. 268 [139]di[171][181](di[173]100)[172]100[179]2 [175] kn[178]0 [167]280
  135. 270 a$[178]p$(tu)[170]" is picking from the discard pile.":[141]420
  136. 272 di[178]h(tu,dr):h(tu,dr)[178]h(tu,4):[129]i[178]1[164]1000:[130]i:[137]168
  137. 274 [139] sc[179]k1 [176] kn[179][177]0 [167] 280
  138. 276 a$[178]p$(tu)[170]" is knocking.":[141]420
  139. 278 kn[178]op:[129]i[178]1[164]1000:[130]i:[137]168
  140. 280 a$[178]p$(tu)[170]" picks a card from the deck.":[141]420
  141. 282 h(tu,4)[178]d(dp):dp[178]dp[170]1
  142. 284 [129]i[178]1[164]4:sc(i)[178]h(tu,i):[130]
  143. 286 [141]386:di[178]h(tu,dr):h(tu,dr)[178]h(tu,4):[129]i[178]1[164]1000:[130]i:[137]168
  144. 288 [143] round over
  145. 290 [153]"":[129]i4[178]1[164]op:[141]432:[130]i4
  146. 292 x[178]0:sc[178]0:[129]i[178]1[164]op:[139]te(i)[177]sc[167]sc[178]te(i)
  147. 294 [130]i
  148. 296 [129]i[178]1[164]op:[139]te(i)[178]sc[167]x[178]x[170]1
  149. 298 [130]i:a$[178]" is":[139]x[177]1[167]a$[178]"s are"
  150. 300 [153]"the winner"a$": ";
  151. 302 [129]i[178]1[164]op:[139]te(i)[178]sc[167][153]p$(i)",";
  152. 304 [139] te(i)[179]sc[167]mo(i)[178]mo(i)[171]5:[139]mo(i)[179]0[167]mo(i)[178]0
  153. 306 [130]i:[153]"cmd."
  154. 308 [153]"press <return> to continue."
  155. 310 [151]198,0
  156. 312 [161]a$:[139]a$[179][177][199](13)[167]312
  157. 314 x[178]0:[129]i[178]1[164]op:[139]mo(i)[179][177]0[167]x[178]x[170]1
  158. 316 [130]i:[139]x[177]1[167]328
  159. 318 [153]"loadthe winner is: ";
  160. 320 [129]i[178]1[164]op:[139]mo(i)[179][177]0[167][153]p$(i)
  161. 322 [130]i:[153]"the winning pot is $";:m[178]op[172]15:[129]i[178]1[164]op:m[178]m[171]mo(i):[130]
  162. 324 [139]p$(1)[178]"observer"[167]m[178]m[171]15
  163. 326 [153]m:[137]342
  164. 328 [139] mo(1)[179][177]0 [167] 130
  165. 330 [139]pl$[178]"d"[167]130
  166. 332 [153]"loadyou are out of the game."
  167. 334 [153]"would you like to watch the others play?"
  168. 336 [151]198,0
  169. 338 [161]a$:[139]a$[179][177]"y"[175]a$[179][177]"n"[167]338
  170. 340 [139]a$[178]"y"[167]pl$[178]"d":[137]130
  171. 342 [153]"press <return> to restart."
  172. 344 [151]198,0
  173. 346 [161]a$:[139]a$[179][177][199](13)[167]346
  174. 348 [138]
  175. 350 [143] print out card(s)
  176. 352 [129]i[178]1[164]3:a[178]q(i):s[178][181](a[173]100):f[178]a[171]s[172]100:s[178]s[170]1
  177. 354 [139]q(i)[178]0[167]382
  178. 356 s$(1)[178]"atn":s$(2)[178]"(NULL)":s$(3)[178]"(NULL)":s$(4)[178]"(NULL)"
  179. 358 c$(1)[178]"2":c$(2)[178]"3":c$(3)[178]"4":c$(4)[178]"5":c$(5)[178]"6":c$(6)[178]"7":c$(7)[178]"8"
  180. 360 c$(8)[178]"9":c$(9)[178]"10":c$(10)[178]"j":c$(11)[178]"q":c$(12)[178]"k":c$(13)[178]"a"
  181. 362 s$[178]s$(s):c$[178]c$(f)
  182. 364 [139][195](c$)[179]2[167]c$[178]" "[170]c$
  183. 366 [153][163](i[171]1)[172]10[170]5)"step       (NULL)wait"
  184. 368 [153][163](i[171]