home *** CD-ROM | disk | FTP | other *** search
/ Dark Star 2 / Dark_Star_02_1995_-_de_Side_B.d64 / poker (.txt) < prev    next >
Commodore BASIC  |  2023-02-26  |  10KB  |  252 lines

  1. 0 goto500
  2. 1 poke792,207:poke793,2:clr:restore:dim fl(52),c%(52):x=rnd(-ti)
  3. 2 poke 53280,5:poke 53281,15:print"[151]":do=1000
  4. 3 goto 11
  5. 4 print"  [213][195][195][195][201]"
  6. 5 print"  [221][166][166][166][221]"
  7. 6 print"  [221][166][166][166][221]"
  8. 7 print"  [221][166][166][166][221]"
  9. 8 print"  [221][166][166][166][221]"
  10. 9 print"[151] [202][195][195][195][203]"
  11. 10 goto76
  12. 11 print"[147]";spc(8);"***********************"
  13. 12 printspc(8);"* war games blackjack[146] *"
  14. 13 printspc(8);"***********************"
  15. 16 goto19
  16. 17 if h>=41 thengoto19
  17. 18 fortd=1to2000:next:print"[147]":goto 31
  18. 19 print"";:zw=zw+1:ifzw>2thengoto1000
  19. 20 print"  shuffling":say"i'm shuffling.":t=149
  20. 21 fordt=1to300:printchr$(t);"  shuffling":ift>155thent=149
  21. 22 t=t+1:nextdt:h=1
  22. 23 for xy=0to52
  23. 24 fl(xy)=0:c%(xy)=0
  24. 25 next xy
  25. 26 rem
  26. 27 for i=1to52
  27. 28 d%=52*rnd(ti)+1
  28. 29 if fl(d%)<>0 goto 28
  29. 30 c%(i)=d%:fl(d%)=1:nexti
  30. 31 print"[151][147]":db$=""
  31. 32 do$=str$(do):ifdo=0thenprint" sorry broke!!":say"sorry your broke.":do=1000:goto19
  32. 33 print"   bank ";:say"the bank is.":printtab(8);"";do;"[151]";
  33. 34 gosub300:print" your bet* ";:say"your bet?"
  34. 35 di$="":getdi$:ifdi$=""then35
  35. 36 ifasc(di$)>47andasc(di$)<58thenprintdi$;:db$=db$+di$:goto35
  36. 37 ifasc(di$)=13thendb=val(db$):goto42
  37. 38 ifasc(di$)=133thendo=1000:goto31
  38. 39 ifasc(di$)=134anddo<24001thendo=do+1000:goto31
  39. 40 ifasc(di$)=135then31
  40. 41 goto35
  41. 42 ifdo<dbordb<1then32
  42. 43 cs(1)=0:cs(2)=0:cs(4)=0:cs(5)=0:cs(3)=0:cs(6)=0:ch=0:cd=0
  43. 44 goto 71
  44. 45 aa=c%(h):h=h+1:bb=aa:goto 4
  45. 46 aa=bb:j=4
  46. 47 a=o:gosub 101
  47. 48 cs(j)=cs(j)+ct(j):cs(j+1)=cs(j+1)+ct(j+1)
  48. 49 goto54
  49. 50 aa=c%(h):h=h+1:j=4
  50. 51 a=6:gosub 101
  51. 52 cs(j)=cs(j)+ct(j):cs(j+1)=cs(j+1)+ct(j+1)
  52. 53 goto 80
  53. 54 goto 191
  54. 55 aa=c%(h):h=h+1:j=4
  55. 56 a=12:gosub 101
  56. 57 cs(j)=cs(j)+ct(j):cs(j+1)=cs(j+1)+ct(j+1)
  57. 58 goto191
  58. 59 aa=c%(h):h=h+1:j=4
  59. 60 a=18:gosub 101
  60. 61 cs(j)=cs(j)+ct(j):cs(j+1)=cs(j+1)+ct(j+1)
  61. 62 goto191
  62. 63 aa=c%(h):h=h+1:j=4
  63. 64 a=24:gosub 101
  64. 65 cs(j)=cs(j)+ct(j):cs(j+1)=cs(j+1)+ct(j+1)
  65. 66 goto191
  66. 67 aa=c%(h):h=h+1:j=4
  67. 68 a=30:gosub 101
  68. 69 cs(j)=cs(j)+ct(j):cs(j+1)=cs(j+1)+ct(j+1)
  69. 70 goto 197
  70. 71 rem
  71. 72 aa=c%(h):h=h+1:j=1
  72. 73 a=400:gosub 101
  73. 74 cs(j)=cs(j)+ct(j):cs(j+1)=cs(j+1)+ct(j+1)
  74. 75 goto 45
  75. 76 aa=c%(h):h=h+1:j=1
  76. 77 a=406:gosub 101
  77. 78 cs(j)=cs(j)+ct(j):cs(j+1)=cs(j+1)+ct(j+1)
  78. 79 goto 50
  79. 80 goto166
  80. 81 aa=c%(h):h=h+1:j=1
  81. 82 a=412:gosub 101
  82. 83 cs(j)=cs(j)+ct(j):cs(j+1)=cs(j+1)+ct(j+1)
  83. 84 if cs(2)>21then208
  84. 85 goto183
  85. 86 aa=c%(h):h=h+1:j=1
  86. 87 a=418:gosub 101
  87. 88 cs(j)=cs(j)+ct(j):cs(j+1)=cs(j+1)+ct(j+1)
  88. 89 if cs(2)>21then208
  89. 90 goto183
  90. 91 aa=c%(h):h=h+1:j=1
  91. 92 a=424:gosub 101
  92. 93 cs(j)=cs(j)+ct(j):cs(j+1)=cs(j+1)+ct(j+1)
  93. 94 if cs(2)>21then208
  94. 95 goto183
  95. 96 aa=c%(h):h=h+1:j=1
  96. 97 a=430:gosub 101
  97. 98 cs(j)=cs(j)+ct(j):cs(j+1)=cs(j+1)+ct(j+1)
  98. 99 if cs(2)>21then208
  99. 100 goto 46
  100. 101 if aa=1  then cc=1:e=1:ee=32:c=32:dd=83:ff=2:ct(j)=11:ct(j+1)=1
  101. 102 if aa=2  then cc=50:e=50:ee=32:c=32:dd=83:ff=2:ct(j)=2:ct(j+1)=2
  102. 103 if aa=3  then cc=51:e=51:ee=32:c=32:dd=83:ff=2:ct(j)=3:ct(j+1)=3
  103. 104 if aa=4  then cc=52:e=52:ee=32:c=32:dd=83:ff=2:ct(j)=4:ct(j+1)=4
  104. 105 if aa=5  then cc=53:e=53:ee=32:c=32:dd=83:ff=2:ct(j)=5:ct(j+1)=5
  105. 106 if aa=6  then cc=54:e=54:ee=32:c=32:dd=83:ff=2:ct(j)=6:ct(j+1)=6
  106. 107 if aa=7  then cc=55:e=55:ee=32:c=32:dd=83:ff=2:ct(j)=7:ct(j+1)=7
  107. 108 if aa=8  then cc=56:e=56:ee=32:c=32:dd=83:ff=2:ct(j)=8:ct(j+1)=8
  108. 109 if aa=9  then cc=57:e=57:ee=32:c=32:dd=83:ff=2:ct(j)=9:ct(j+1)=9
  109. 110 if aa=10 then cc=49:e=48:ee=48:c=49:dd=83:ff=2:ct(j)=10:ct(j+1)=10
  110. 111 if aa=11 then cc=10:e=10:ee=32:c=32:dd=83:ff=2:ct(j)=10:ct(j+1)=10
  111. 112 if aa=12 then cc=17:e=17:ee=32:c=32:dd=83:ff=2:ct(j)=10:ct(j+1)=10
  112. 113 if aa=13 then cc=11:e=11:ee=32:c=32:dd=83:ff=2:ct(j)=10:ct(j+1)=10
  113. 114 if aa=14 then cc=1:e=1:ee=32:c=32:dd=90:ff=2:ct(j)=11:ct(j+1)=1
  114. 115 if aa=15 then cc=50:e=50:ee=32:c=32:dd=90:ff=2:ct(j)=2:ct(j+1)=2
  115. 116 if aa=16 then cc=51:e=51:ee=32:c=32:dd=90:ff=2:ct(j)=3:ct(j+1)=3
  116. 117 if aa=17 then cc=52:e=52:ee=32:c=32:dd=90:ff=2:ct(j)=4:ct(j+1)=4
  117. 118 if aa=18 then cc=53:e=53:ee=32:c=32:dd=90:ff=2:ct(j)=5:ct(j+1)=5
  118. 119 if aa=19 then cc=54:e=54:ee=32:c=32:dd=90:ff=2:ct(j)=6:ct(j+1)=6
  119. 120 if aa=20 then cc=55:e=55:ee=32:c=32:dd=90:ff=2:ct(j)=7:ct(j+1)=7
  120. 121 if aa=21 then cc=56:e=56:ee=32:c=32:dd=90:ff=2:ct(j)=8:ct(j+1)=8
  121. 122 if aa=22 then cc=57:e=57:ee=32:c=32:dd=90:ff=2:ct(j)=9:ct(j+1)=9
  122. 123 if aa=23 then cc=49:e=48:ee=48:c=49:dd=90:ff=2:ct(j)=10:ct(j+1)=10
  123. 124 if aa=24 then cc=10:e=10:ee=32:c=32:dd=90:ff=2:ct(j)=10:ct(j+1)=10
  124. 125 if aa=25 then cc=17:e=17:ee=32:c=32:dd=90:ff=2:ct(j)=10:ct(j+1)=10
  125. 126 if aa=26 then cc=11:e=11:ee=32:c=32:dd=90:ff=2:ct(j)=10:ct(j+1)=10
  126. 127 if aa=27 then cc=1:e=1:ee=32:c=32:dd=65:ff=0:ct(j)=11:ct(j+1)=1
  127. 128 if aa=28 then cc=50:e=50:ee=32:c=32:dd=65:ff=0:ct(j)=2:ct(j+1)=2
  128. 129 if aa=29 then cc=51:e=51:ee=32:c=32:dd=65:ff=0:ct(j)=3:ct(j+1)=3
  129. 130 if aa=30 then cc=52:e=52:ee=32:c=32:dd=65:ff=0:ct(j)=4:ct(j+1)=4
  130. 131 if aa=31 then cc=53:e=53:ee=32:c=32:dd=65:ff=0:ct(j)=5:ct(j+1)=5
  131. 132 if aa=32 then cc=54:e=54:ee=32:c=32:dd=65:ff=0:ct(j)=6:ct(j+1)=6
  132. 133 if aa=33 then cc=55:e=55:ee=32:c=32:dd=65:ff=0:ct(j)=7:ct(j+1)=7
  133. 134 if aa=34 then cc=56:e=56:ee=32:c=32:dd=65:ff=0:ct(j)=8:ct(j+1)=8
  134. 135 if aa=35 then cc=57:e=57:ee=32:c=32:dd=65:ff=0:ct(j)=9:ct(j+1)=9
  135. 136 if aa=36 then cc=49:e=48:ee=48:c=49:dd=65:ff=0:ct(j)=10:ct(j+1)=10
  136. 137 if aa=37 then cc=10:e=10:ee=32:c=32:dd=65:ff=0:ct(j)=10:ct(j+1)=10
  137. 138 if aa=38 then cc=17:e=17:ee=32:c=32:dd=65:ff=0:ct(j)=10:ct(j+1)=10
  138. 139 if aa=39 then cc=11:e=11:ee=32:c=32:dd=65:ff=0:ct(j)=10:ct(j+1)=10
  139. 140 if aa=40 then cc=1:e=1:ee=32:c=32:dd=88:ff=0:ct(j)=11:ct(j+1)=1
  140. 141 if aa=41 then cc=50:e=50:ee=32:c=32:dd=88:ff=0:ct(j)=2:ct(j+1)=2
  141. 142 if aa=42 then cc=51:e=51:ee=32:c=32:dd=88:ff=0:ct(j)=3:ct(j+1)=3
  142. 143 if aa=43 then cc=52:e=52:ee=32:c=32:dd=88:ff=0:ct(j)=4:ct(j+1)=4
  143. 144 if aa=44 then cc=53:e=53:ee=32:c=32:dd=88:ff=0:ct(j)=5:ct(j+1)=5
  144. 145 if aa=45 then cc=54:e=54:ee=32:c=32:dd=88:ff=0:ct(j)=6:ct(j+1)=6
  145. 146 if aa=46 then cc=55:e=55:ee=32:c=32:dd=88:ff=0:ct(j)=7:ct(j+1)=7
  146. 147 if aa=47 then cc=56:e=56:ee=32:c=32:dd=88:ff=0:ct(j)=8:ct(j+1)=8
  147. 148 if aa=48 then cc=57:e=57:ee=32:c=32:dd=88:ff=0:ct(j)=9:ct(j+1)=9
  148. 149 if aa=49 then cc=49:e=48:ee=48:c=49:dd=88:ff=0:ct(j)=10:ct(j+1)=10
  149. 150 if aa=50 then cc=10:e=10:ee=32:c=32:dd=88:ff=0:ct(j)=10:ct(j+1)=10
  150. 151 if aa=51 then cc=17:e=17:ee=32:c=32:dd=88:ff=0:ct(j)=10:ct(j+1)=10
  151. 152 if aa=52 then cc=11:e=11:ee=32:c=32:dd=88:ff=0:ct(j)=10:ct(j+1)=10
  152. 153 restore
  153. 154 for v=1106to1306step40
  154. 155 for n=0to4
  155. 156 read q:poke a+v+n,q:poke a+v+n+54272,ff:next n
  156. 157 next v
  157. 158 restore
  158. 159 poke a+1147,cc:poke a+55419,ff:poke a+1148,ee:poke a+55420,ff
  159. 160 poke a+1187,dd:poke a+55459,ff:poke a+1269,e:pokea+55541,ff
  160. 161 poke a+1268,c:poke a+55540,ff:poke a+1229,dd:poke a+55501,ff
  161. 162 return
  162. 163 data 85,67,67,67,73,66,32,32,32,66
  163. 164 data 66,32,32,32,66,66,32,32,32,66
  164. 165 data 66,32,32,32,66,74,67,67,67,75,10001
  165. 166 ifct(4)=11anddo>=1.5*dbthen211
  166. 167 goto223
  167. 168 print"   "
  168. 169 print"   h[146]it";:say"hit?"
  169. 170 ifdo<2*dbthen172
  170. 171 ifcs(1)>8andcs(1)<12thenprint", s[146]tand or d[146]ouble ";:say"stand or double?":goto173
  171. 172 print" or s[146]tand ";:say"or stand?"
  172. 173 c$="":getc$:ifc$=""then173
  173. 174 if c$="s"thenprintc$:goto182
  174. 175 if c$="h"thenprintc$:goto81
  175. 176 if c$="d"thenprintc$:goto178
  176. 177 goto 173
  177. 178 db=2*db:print"                                "
  178. 179 print"[145]   bet now ";:say"bet now.":printtab(11);db;
  179. 180 aa=c%(h):h=h+1:a=412:j=1:gosub101
  180. 181 cs(j)=cs(j)+ct(j):cs(j+1)=cs(j+1)+ct(j+1)
  181. 182 goto46
  182. 183 print"                                  "
  183. 184 print"[145]   h[146]it or s[146]tand ";:say"hit.   or stand?"
  184. 185 c$="":getc$:ifc$=""then185
  185. 186 ifc$="h"orc$="s"thenprintc$
  186. 187 if c$="h"thench=ch+1:onchgoto86,91,96
  187. 188 if c$="s"then 46
  188. 189 goto 183
  189. 190 cd=cd+1:oncdgoto55,59,63,67
  190. 191 print"                                     "
  191. 192 if cs(j)=17andcs(j+1)<17thenww$="[145]   dealer takes a hit":printww$:sayww$:goto190
  192. 193 if cs(j)<17thenww$="[145]   dealer takes a hit":printww$:sayww$:goto190
  193. 194 if cs(j)>21andcs(j+1)<17thenww$="[145]   dealer takes a hit":printww$:sayww$:goto190
  194. 195 ifcs(j)>16andcs(j)<22thenww$="[145]   dealer stands":printww$:sayww$:goto197
  195. 196 ifcs(j+1)<22andcs(j+1)>16thenww$="[145]   dealer stands":printww$:sayww$:goto197
  196. 197 gosub300:if cs(1)<22thencs(3)=cs(1):goto199
  197. 198 cs(3)=cs(2)
  198. 199 ifcs(5)>21thenprint"   dealer busted! you win":do=do+db:db=0:say"owel."
  199. 200 ifcs(5)>21then210
  200. 201 if cs(4)<22thencs(6)=cs(4):goto203
  201. 202 cs(6)=cs(5)
  202. 203 say"totals.me.":print"   dealer";cs(6);:gosub300:printtab(13);" you";cs(3);
  203. 204 say"you.":if cs(3)=cs(6)thenprint" we push":say"we push.":db=0:goto210
  204. 205 ifcs(6)>cs(3)andcs(6)<22thenprint" you lose":say"you loose.":do=do-db:db=0:goto210
  205. 206 print" you win":say"you win.":do=do+db:db=0
  206. 207 goto 210
  207. 208 print"   you busted!!":say"you busted.":do=do-db:db=0:goto210
  208. 209 aa=bb:a=0:gosub101
  209. 210 goto17
  210. 211 print"   insurance y[146] or n[146] ";:say"insurence  yes or no."
  211. 212 in$="":getin$:ifin$=""then212
  212. 213 ifin$="y"thenprintin$:goto216
  213. 214 ifin$="n"thenprintin$:goto223
  214. 215 goto212
  215. 216 ifbb=10orbb=11orbb=12orbb=13orbb=23orbb=24orbb=25orbb=26then220
  216. 217 ifbb=36orbb=37orbb=38orbb=39orbb=49orbb=50orbb=51orbb=52then220
  217. 218 print"                         ":do=do-db/2
  218. 219 print"   no blackjack!":say"no blackjack.":goto223
  219. 220 ifct(1)=21thenprint"                               ":do=do+db/2
  220. 221 ifct(1)=21thenprint"   we push!!":say"we push.":goto209
  221. 222 print"   blackjack!!":say"blackjack!":goto209
  222. 223 ifcs(1)=21thencs(3)=21
  223. 224 ifcs(4)=10orcs(4)=11then228
  224. 225 ifcs(3)=21thenprint"   your blackjack!":do=do+db*1.5:say"yourblackjack"
  225. 226 ifcs(3)=21then210
  226. 227 goto168
  227. 228 ifcs(4)=10then232
  228. 229 ifbb=10orbb=11orbb=12orbb=13orbb=23orbb=24orbb=25orbb=26then234
  229. 230 ifbb=36orbb=37orbb=38orbb=39orbb=49orbb=50orbb=51orbb=52then234
  230. 231 goto225
  231. 232 ifbb=1orbb=14orbb=27orbb=40then234
  232. 233 goto225
  233. 234 ifcs(3)=21thenprint"   we push!!":say"we push.":goto209
  234. 235 print"   dealer blackjack!!":say"dealer blackjack.":do=do-db:goto209
  235. 300 forww=1to1000:next:return
  236. 500 ifpeek(49153)=187then550
  237. 510 poke53280,6:poke53281,6:print"[147]";tab(8);"  loading sub programs  [146]"
  238. 520 load"sam",8,1
  239. 550 poke52,125:poke54,125:poke56,125:sys38144:]re:]sp 68:]pi 68:]li 1
  240. 555 poke720,8:poke739,49:poke744,48:poke749,48:poke754,48:poke758,169
  241. 560 poke743,169:]kn 150,150:print"[147]":goto1
  242. 1000 poke53280,6:poke53281,6
  243. 1001 poke792,207:poke793,2:print"[147]  do you want to return to war games":x$=""
  244. 1002 print"  or play more poker or quit ? (w/p/q)"
  245. 1003 say"do you want to return to war games or play more poker       ..sucker."
  246. 1005 getx$:ifx$=""then1005
  247. 1010 ifx$="q"thenprint"[147]  bye bye":say"bye bye.":end
  248. 1015 ifx$="w"then1020
  249. 1017 goto1
  250. 1020 print"[147]load";chr$(34);"war menu";chr$(34);",8,1"
  251. 1030 poke631,19:poke632,13:poke633,82:poke634,117:poke635,13:poke198,5:end
  252.