home *** CD-ROM | disk | FTP | other *** search
/ UpTime Volume 1 #2 / utv1n2s1.d64 / fishy (.txt) < prev    next >
Commodore BASIC  |  2022-08-28  |  8KB  |  307 lines

  1. 5 poke52,48:poke56,48:clr
  2. 10 f$(1)="":f$(2)="[146]":x=rnd(-ti)
  3. 20 c$="                                        "
  4. 30 e$="                        "
  5. 40 s=54272:v=53248:x=24:x1=24:pl=2:nm=0
  6. 50 nc=36:dima(nc),d(nc),t(nc)
  7. 60 poke 53281,0:poke53280,6:print"[147]"
  8. 70 printtab(11)"           "
  9. 80 printtab(11)"       "
  10. 90 printtab(11)"            "
  11. 100 printtab(11)"      "
  12. 110 printtab(11)"          "
  13. 120 fori=0to24:pokes+i,0:next
  14. 130 for i=49152to49152+81:reada:pokei,a:next
  15. 140 data 173,14,220,41,254,141
  16. 150 data 14,220,165,1,41,251
  17. 160 data 133,1,160,0,185,0
  18. 170 data 208,153,0,48,185,0
  19. 180 data 209,153,0,49,185,0
  20. 190 data 210,153,0,50,185,0
  21. 200 data 211,153,0,51,185,0,212,153,0,52,185,0,213,153,0,53,185,0,214,153,0,54
  22. 210 data 185,0,215,153,0,55
  23. 220 data 200,208,205,165,1,9,4,133
  24. 230 data 1,173,14,220,9,1
  25. 240 data 141,14,220,96
  26. 250 sys49152
  27. 260 fori=12632to12639:reada:pokei,a:next
  28. 270 data 31,48,100,204,96,48,31,0
  29. 280 fori=12648to12655:reada:pokei,a:next
  30. 290 data 134,200,118,32,118,200,134,0
  31. 300 fori=12632+1024to12639+1024:reada:pokei,a:next
  32. 310 data 224,207,155,51,159,207,224,255
  33. 320 fori=12648+1024to12655+1024:reada:pokei,a:next
  34. 330 data 121,55,137,223,137,55,121,255
  35. 340 poke53272,(peek(53272)and240)+12
  36. 350 print"":fori=35to1step-1:print"[145]"tab(i)"+- "
  37. 360 gosub2210:next
  38. 370 fori=832to894:reada:pokei,a:next
  39. 380 poke2040,13:pokev,24:pokev+1,108:pokev+28,1
  40. 390 pokev+37,2:pokev+38,0:pokev+39,4
  41. 400 pokev+29,1:pokev+23,1:pokev+27,1
  42. 410 print"[145]        fisherman's name: ";:gosub3000
  43. 414 if k$=chr$(140) then 1160
  44. 415 if t$="" then t$="fisher"
  45. 420 print"[157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157]                                "
  46. 430 n$(2)=t$:n$(1)="64"
  47. 440 print"    please wait [192] stocking the pond"
  48. 450 gosub1670:gosub3500:poke53280,3:poke53281,1:
  49. 460 print"[147]"tab(28)"[151]           ":printtab(28)"           "
  50. 470 print"[151]"tab(28)n$(1)":"tab(36)s(1)
  51. 480 printtab(28)""n$(2)":"tab(36)s(2)
  52. 490 print:printtab(34)"[129][205][221][206]"
  53. 500 printtab(34)"[192][209][192]"
  54. 510 printtab(34)"[206][221][205]"
  55. 520 print"";
  56. 530 fori=1to20:print"[169][223]";:next:printc$;
  57. 540 fori=1to4
  58. 550 print"    +-  +-  +-  +-  +-  +-  +-  +-  +-  ";:printc$;
  59. 560 next:print
  60. 570 print"[145][149]cards:                                  ";
  61. 580 fori=1to2:print"[149]"c$;:next
  62. 590 fori=1984to2023:pokei,160:pokei+s,9:next
  63. 600 pokev+21,1
  64. 610 form=1to5
  65. 620 h=0
  66. 630 k=0:print"[144][146]"n$(2)","
  67. 640 print"please choose a card"
  68. 650 gosub1750:gosub2250
  69. 660 ifh<0then620
  70. 670 pl=1:gosub2010
  71. 680 print"[144]"n$(1)","
  72. 690 print"please choose a card"
  73. 700 ford=1to1000:next:gosub2050
  74. 710 gosub2140:gosub2250:gosub2010:pl=2
  75. 720 nextm
  76. 730 ifnm=9then1060
  77. 740 ifw(1)=0then1060
  78. 750 ifw(2)=0then1060
  79. 760 ifs(1)>4then1060
  80. 770 ifs(2)>4then1060
  81. 780 print"[144]"n$(1)","
  82. 790 print"do you have any [175]'s ?[157][157][157][157][157]";:gosub3200:k$=nm$
  83. 800 k=val(k$):ifk<1ork>9thengosub2010:goto730
  84. 810 gosub2450
  85. 820 iffl<>0then840
  86. 830 gosub2010:print"you don't have any":fort=1to1000:next:gosub2010:goto780
  87. 840 r=k:gosub2410:gosub2010
  88. 850 iffl=1thengosub1180:gosub2250:goto730
  89. 860 iffl=0thengosub1330
  90. 870 ifg=1then730
  91. 880 ifnm=9then1060
  92. 890 ifw(2)=0then1060
  93. 900 ifw(1)=0then1060
  94. 910 ifs(1)>4then1060
  95. 920 ifs(2)>4then1060
  96. 930 pl=1:r=int(rnd(1)*9)+1
  97. 940 ifcd(r,1)=0orcd(r,1)=5then930
  98. 950 print"[144]"n$(2)","
  99. 960 print"do you have any"r"[144]'s ?";
  100. 961 get k$:ifk$=""then 961
  101. 965 if asc(k$)=140 then 1160
  102. 970 ifk$<>"y"andk$<>"n"thengosub2010:goto950
  103. 980 ifk$="n"then1020
  104. 990 gosub1380:gosub2010
  105. 1000 iffl=1then950
  106. 1010 goto880
  107. 1020 gosub1490
  108. 1030 iffl=1thengosub2010:goto950
  109. 1040 ifg=1then880
  110. 1050 pl=2:goto730
  111. 1060 gosub2010
  112. 1070 printtab(5)"[144]game over!":gosub2160
  113. 1080 t=2
  114. 1090 print"";f$(t);
  115. 1100 ifs(1)>s(2)thenprinttab(5)n$(1)" wins"
  116. 1110 ifs(2)>s(1)thenprinttab(5)n$(2)" wins"
  117. 1120 ifs(1)=s(2)thenprinttab(5)"tie game!"
  118. 1130 print"[144]     play again?"
  119. 1140 getk$:ifk$=""thenprint"[145][145][145][145][145]":ford=1to200:t=3-t:goto1090
  120. 1150 ifk$="y"thenpokev+21,0:run
  121. 1160 poke52,128:poke56,128:clr:sys(8*4096)+4
  122. 1170 -----rem have cards (c)-----
  123. 1180 print"yes, i have"cd(k,1)"card(s).":fort=1to500:next
  124. 1190 w(1)=w(1)-cd(k,1)
  125. 1200 w(2)=w(2)+cd(k,1)
  126. 1210 b=cd(k,1):cd(k,1)=0
  127. 1220 cd(k,2)=cd(k,2)+b
  128. 1230 co=2
  129. 1240 fori=0tocd(k,2)-1
  130. 1250 poke1945+4*(k-1)+i,k+48
  131. 1260 poke1945+4*(k-1)+i+s,co
  132. 1270 ifco=2thengosub2140
  133. 1280 next
  134. 1290 fort=1to500:next
  135. 1300 ifco=2thenco=0:goto1240
  136. 1310 gosub2010:return
  137. 1320 -----rem no cards (c)-----
  138. 1330 g=0:gosub2010:print"no [192] go fish!"
  139. 1340 h=0:gosub1750
  140. 1350 ifh<0then1340
  141. 1360 gosub2010:gosub2250:return
  142. 1370 -----rem have cards (p)-----
  143. 1380 fl=0
  144. 1390 ifcd(r,2)=0then1470
  145. 1400 cd(r,1)=cd(r,1)+cd(r,2)
  146. 1410 w(2)=w(2)-cd(r,2)
  147. 1420 w(1)=w(1)+cd(r,2)
  148. 1430 cd(r,2)=0
  149. 1440 fori=0to3
  150. 1450 poke1945+4*(r-1)+i,160:poke1945+4*(r-1)+i+s,9:next:gosub2140
  151. 1460 gosub2010:gosub2250:gosub2010:return
  152. 1470 gosub2010:print"no you don't!":ford=1to1000:next:fl=1:return
  153. 1480 -----rem no cards (p)-----
  154. 1490 k=r:gosub2010:gosub2410
  155. 1500 iffl=0then1530
  156. 1510 gosub2010:print"that's not right!"
  157. 1520 fort=1to1000:next:gosub2010:return
  158. 1530 g=0:gosub2010:print"no [192] go fish"
  159. 1540 gosub2050:gosub2140
  160. 1550 ifc=rthenprint"    got one!!![144]":fort=1to1000:next:g=1
  161. 1560 gosub2010:gosub2250:gosub2010:return
  162. 1570 -----rem sprite data-----
  163. 1580 data 0,48,0,0,48,0,0,184
  164. 1590 data 0,0,184,0,2,186,0,2
  165. 1600 data 186,0,10,186,128,10,186,128
  166. 1610 data 42,186,160,42,186,160,170,186
  167. 1620 data 168,0,48,0,0,48,3,0
  168. 1630 data 48,12,85,85,84,21,85,80
  169. 1640 data 21,85,80,5,85,64,1,85
  170. 1650 data 0,0,0,0,0,0,0,0
  171. 1660 -----rem set deck-----
  172. 1670 fori=0to8:forj=1to4:a(j+i*4)=i+1:next:next
  173. 1680 fori=1to36:t(i)=0:next
  174. 1690 fori=1to36
  175. 1700 r=int(rnd(1)*36)+1
  176. 1710 ift(r)=1then1700
  177. 1720 d(i)=a(r):t(r)=1
  178. 1730 next:return
  179. 1740 -----rem go fish-----
  180. 1750 ifnc=0thenreturn
  181. 1760 x=x+2:ifx=256thenpo=1:x=0
  182. 1770 x1=x1+2
  183. 1780 ifx=70andpeek(v+16)=1thenpo=0:x=0:x1=0
  184. 1790 pokev,x:pokev+16,po
  185. 1800 getk$:ifk$=" "then1820
  186. 1802 if k$="" then goto1760
  187. 1805 if asc(k$)=140 then 1160
  188. 1810 goto1760
  189. 1820 ifx1>290then1760
  190. 1830 t=int((x1-24)/8):t=1510+t
  191. 1840 poket,66+128:poket+s,6
  192. 1850 fori=1to7
  193. 1860 ifpeek(t+40*i)<>160thenb=t+40*i:goto1920
  194. 1870 poket+40*i,66+128:pokes+t+40*i,6
  195. 1880 next
  196. 1890 print"missed[192]try again."
  197. 1900 fori=0to7:poket+40*i,160:next
  198. 1910 ford=1to1000:next:gosub2010:h=h-1:return
  199. 1920 pokeb-1,160:pokeb,160:pokeb+1,160
  200. 1930 fori=btotstep-40:pokei,160:next
  201. 1940 c=d(nc):nc=nc-1
  202. 1950 ifk<>cthen1970
  203. 1960 print"     got one!!![144]":gosub2140:fort=1to1000:next:gosub2010:g=1
  204. 1970 cd(c,2)=cd(c,2)+1:k=c
  205. 1980 gosub1230:w(2)=w(2)+1
  206. 1990 return
  207. 2000 -----rem clear screen-----
  208. 2010 print"";
  209. 2020 fori=1to4:printe$:next:print"";
  210. 2030 return
  211. 2040 -----rem go fish-----
  212. 2050 ifnc=0thenreturn
  213. 2060 fori=1544to1823
  214. 2070 ifpeek(i)<>160then2090
  215. 2080 next:return
  216. 2090 pokei,160:pokei+1,160
  217. 2100 c=d(nc):nc=nc-1
  218. 2110 cd(c,1)=cd(c,1)+1
  219. 2120 w(1)=w(1)+1:return
  220. 2130 -----rem sound-----
  221. 2140 pokes+24,15:pokes+6,240:pokes+5,0:pokes+1,25:pokes,177:pokes+4,17
  222. 2150 ford=1to50:next:pokes+24,0:return
  223. 2160 pokes+24,15:pokes+5,9:pokes+6,0
  224. 2170 forj=1to3:pokes+4,17
  225. 2180 pokes,75:pokes+1,34
  226. 2190 ford=1to250:next:pokes+4,16:ford=1to50:next:next
  227. 2200 pokes+24,0:return
  228. 2210 pokes+24,15:pokes+6,240:pokes+5,0:pokes+4,17
  229. 2220 pokes+1,100:pokes,100
  230. 2230 pokes+24,0:return
  231. 2240 -----rem check for matches-----
  232. 2250 gosub2010
  233. 2260 fori=1to9
  234. 2270 if cd(i,pl)=4then2290
  235. 2280 next:return
  236. 2290 print"[144]   [213][192][192][192][192][192][192][192][192][201]"
  237. 2300 print"   [221] match! [221]"
  238. 2310 print"   [202][192][192][192][192][192][192][192][192][203]"
  239. 2320 gosub2160
  240. 2330 s(pl)=s(pl)+1:cd(i,pl)=5
  241. 2340 ifpl=2thenforj=0to3:poke1945+4*(i-1)+j,160:poke1945+4*(i-1)+j+s,9:next
  242. 2350 print"[151]"tab(28)n$(1)":"tab(36)s(1)
  243. 2360 printtab(28)""n$(2)":"tab(36)s(2)
  244. 2370 fort=1to1500:next:nm=nm+1
  245. 2380 w(pl)=w(pl)-4
  246. 2390 gosub2010:return
  247. 2400 -----rem check for cards in hand--
  248. 2410 fl=1
  249. 2420 ifcd(k,3-pl)=0thenfl=0
  250. 2430 ifcd(k,3-pl)=5thenfl=0
  251. 2440 return
  252. 2450 fl=1
  253. 2460 ifcd(k,2)=0thenfl=0
  254. 2470 ifcd(k,2)=5thenfl=0
  255. 2480 retu