home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 124 / 124.d81 / chum.bas (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  8KB  |  289 lines

  1. 10 rem@ s 1024
  2. 20 dimh(105,4),x(36),y(36),g(6,6),gg(105),e(3),m$(4),ms$(3),mm$(3),u(3),uu(3)
  3. 22 dimgk(6,6)
  4. 30 dv=peek(186):ifdv<8thendv=8
  5. 32 i=rnd(-ti)
  6. 40 poke53280,0
  7. 42 close15:open15,dv,15,"r0:chum scores=chum scores":input#15,er:close15
  8. 44 ifer<>63then90
  9. 60 close2:open2,dv,2,"chum scores,s,r"
  10. 70 fori=1to3:input#2,u(i):input#2,uu(i):next
  11. 80 close2
  12. 90 poke53270,216:poke53265,11
  13. 100 cb=0:poke53281,cb:poke53282,14:poke53283,14:print"[147]"
  14. 110 poke53272,25
  15. 120 goto670
  16. 130 :
  17. 140 :rem checkerboard
  18. 150 :
  19. 160 print"[154]";:fori=0to5:forj=0to5
  20. 170 poke214,2+i*2:print
  21. 180 printtab(11+j*3)ck$(0)
  22. 190 next:next
  23. 200 return
  24. 210 :
  25. 220 :rem box
  26. 230 :
  27. 240 poke214,y:print:poke646,c
  28. 250 printtab(x)"[176]"left$(h$,xx)"[174]"
  29. 260 fori=1toyy:printtab(x)"[221]"tab(x+xx+1)"[221]":next
  30. 270 printtab(x)"[173]"left$(h$,xx)"[189]"
  31. 280 return
  32. 290 :
  33. 300 :rem message
  34. 310 :
  35. 320 poke214,18:print
  36. 330 fori=0to2:printtab(3)"[159]"left$(sp$,34)"[145]"
  37. 340 print""tab(20-(len(ms$(i))/2))ms$(i)
  38. 350 next
  39. 360 return
  40. 370 :
  41. 380 :rem sounds
  42. 390 :
  43. 400 s=54272:pokes+1,sd*20:pokes+5,9
  44. 410 pokes+15,sd*11:pokes+24,15:pokes+4,21
  45. 412 ti$="000000"
  46. 414 ifti<30then414
  47. 420 pokes+4,20
  48. 430 return
  49. 440 :
  50. 450 :rem prompt
  51. 460 :
  52. 470 ms$(0)="[195][193][204][200][207][207][206]'[211] [195][200][213][205] [195][200][193][204][204][197][206][199][197]"
  53. 480 ms$(1)="[217]our opponent: "+mm$(lv/4)
  54. 490 ms$(2)="([209])uit   ([200])elp   ([211])cores":gosub320
  55. 500 return
  56. 510 :
  57. 520 :rem check for square
  58. 530 :
  59. 540 n=y*6+x
  60. 550 fori=0to104
  61. 560 forj=0to3
  62. 570 ifh(i,j)<>nthen610
  63. 580 pq=0:fl=-1:fork=0to3:ifk=jthen600
  64. 590 ifgg(h(i,k))<>pthenpq=1:k=3
  65. 600 next:ifpq=0thenfl=i:j=3:i=104
  66. 610 next
  67. 620 next
  68. 630 return
  69. 640 :
  70. 650 :rem startup
  71. 660 :
  72. 670 print"[147]"
  73. 680 ck$(0)="[173][174][175][157][157][157][176][177][178]":ck$(1)="[161][162][163][157][157][157][164][165][166]":ck$(2)="[167][168][169][157][157][157][170][171][172]"
  74. 690 bg$="\[\[\[\[\[\[\[\[\[\[\[\[\[\[\[\[\[\[\[\[\"
  75. 700 bh$="[\[\[\[\[\[\[\[\[\[\[\[\[\[\[\[\[\[\[\[\["
  76. 710 h$="[192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192]"
  77. 720 sp$="                                   "
  78. 722 m$(1)="  [198]enton [200]ardy  ":mm$(1)="[198]enton"
  79. 724 m$(2)="  [198]rank and [202]oe ":mm$(2)="[200]ardys"
  80. 725 m$(3)="  [195]het [205]orton   ":mm$(3)="[195]het"
  81. 726 m$(4)="      [209]uit      "
  82. 730 ms$(1)=left$(sp$,34)
  83. 740 pl$(1)="[199][210][197][197][206]":pl$(2)="[210][197][196]"
  84. 750 e(0)=14:e(1)=10:e(2)=13
  85. 760 z=40:w=1024+11+2*z
  86. 770 s=54272:fori=stos+24:pokei,0:next
  87. 780 fori=0to104:forj=0to3
  88. 790 readh(i,j)
  89. 800 next:next
  90. 810 co(0)=0:co(1)=0:co(2)=2:co(3)=7
  91. 820 fori=828to970:reada:pokei,a:next
  92. 830 fori=0to35:x(i)=11+3*(i-int(i/6)*6):y(i)=2+2*int(i/6):next
  93. 840 print"";:fori=0to11:printleft$(bg$,40);:printright$(bg$,40);:next
  94. 850 printleft$(bg$,38)"[157][157][148][148]\["
  95. 860 fori=217to242:pokei,peek(i)or128:next
  96. 861 p=1
  97. 862 x=10:y=1:xx=18:yy=12:c=3:gosub240
  98. 863 fori=0to11:poke214,2+i:print:printtab(11)""left$(sp$,18):next
  99. 864 poke214,3:print:printtab(13)"[195][193][204][200][207][207][206]'[211] [195][200][213][205]"
  100. 866 printtab(15)"[195][200][193][204][204][197][206][199][197]"
  101. 868 fori=1to4:print""tab(12)m$(i):next
  102. 870 x=2:y=17:xx=34:yy=3:c=3:gosub240
  103. 872 ms$(0)="":ms$(1)="[195]hoose your opponent":ms$(2)="":gosub320
  104. 876 m=1:poke53265,27
  105. 878 poke214,4+m*2:print:printtab(12)""m$(m)"[145]"
  106. 880 jy=peek(56320):geta$:ifa$=""andjy=127then880
  107. 882 poke214,4+m*2:print:printtab(12)"[159]"m$(m)"[145]"
  108. 884 ifa$=chr$(13)orjy<112thensd=int(rnd(1)*5)+2:gosub400:goto890
  109. 885 ifa$=""orjy=125thenm=m+1:ifm>4thenm=1
  110. 886 ifa$="[145]"orjy=126thenm=m-1:ifm<1thenm=4
  111. 887 goto878
  112. 890 ifm=4then1530
  113. 892 lv=m*4:co=1
  114. 896 x=2:y=17:xx=34:yy=3:c=3:gosub240
  115. 898 gosub160:sys886
  116. 900 gosub470
  117. 920 fori=0to5:forj=0to5:g(i,j)=0:next:next
  118. 930 fori=0to104:gg(i)=0:next:xd=0:yd=0
  119. 947 :
  120. 948 :rem loop
  121. 949 :
  122. 950 ifp=1thenx=xd:y=yd:goto980
  123. 952 w=0
  124. 960 x=int(rnd(1)*6):y=int(rnd(1)*6)
  125. 970 ifg(x,y)then960
  126. 980 poke646,e(p)
  127. 990 poke214,2+y*2:print:printtab(11+3*x)ck$(1)"[145][157][157][157]";
  128. 1000 fori=0to40:next
  129. 1010 printck$(0)"[145][157][157][157]";
  130. 1012 fori=0to30:next
  131. 1020 ifp=2thensd=10:gosub400:gosub540:goto1160
  132. 1030 jy=peek(56320):geta$:ifa$=""andjy=127then990
  133. 1040 ifa$=chr$(13)orjy<112then1140
  134. 1050 k=0:ifg(x,y)thenk=1
  135. 1060 poke646,e(g(x,y)):printck$(k)
  136. 1070 ifa$="[145]"orjy=126theny=y-1:ify<0theny=5
  137. 1080 ifa$=""orjy=125theny=y+1:ify>5theny=0
  138. 1090 ifa$="[157]"orjy=123thenx=x-1:ifx<0thenx=5
  139. 1100 ifa$=""orjy=119thenx=x+1:ifx>5thenx=0
  140. 1110 ifa$="h"thensys928:gosub1300:sys949:goto980
  141. 1112 ifa$="s"thensd=4:gosub400:sys928:sq=1:goto1276
  142. 1120 ifa$="q"thensd=3:gosub400:gosub1470:goto980
  143. 1130 goto980
  144. 1140 ifg(x,y)thensd=1:gosub400:goto980
  145. 1150 sd=11:gosub400:gosub540:rem square?
  146. 1160 iffl>-1then1202
  147. 1170 g(x,y)=p:gg(x+6*y)=p
  148. 1172 ifp=1thenxd=x:yd=y
  149. 1180 sd=6:gosub400:poke646,e(p):printck$(1)
  150. 1182 fori=0to5:forj=0to5:gk(i,j)=0:next:next
  151. 1190 p=p+1:ifp>2thenp=1
  152. 1192 co=co+1
  153. 1200 goto950
  154. 1202 ifp=1then1218
  155. 1204 iflv<12then1216
  156. 1206 ifco<20then1216
  157. 1208 fori=0to5:forj=0to5
  158. 1210 ifg(i,j)orgk(i,j)then1214
  159. 1212 x=i:y=j:gk(i,j)=1:i=5:j=5:next:next:goto980
  160. 1214 next:next:goto1218
  161. 1216 ifw<lvthenw=w+1:goto960
  162. 1218 ms$(1)="":ms$(0)=pl$(p)+" wins!!!":ms$(2)="[208]ress a key":gosub320
  163. 1220 fori=0to3
  164. 1230 poke214,y(h(fl,i)):print:printtab(x(h(fl,i)))ck$(1):next:zz=1-zz
  165. 1240 ifzzthenpoke646,0
  166. 1250 ifzz=0thenpoke646,e(p)
  167. 1260 jy=peek(56320):geta$:ifa$=""andjy=127then1220
  168. 1262 ifp=1thenu(lv/4)=u(lv/4)+1
  169. 1264 ifp=2thenuu(lv/4)=uu(lv/4)+1
  170. 1266 close15:open15,dv,15,"s0:chum scores":close15
  171. 1268 close2:open2,dv,2,"chum scores,s,w"
  172. 1270 fori=1to3
  173. 1272 print#2,u(i):print#2,uu(i)
  174. 1274 next:close2
  175. 1276 fori=0to11:poke214,2+i:print:printtab(11)"[159]"left$(sp$,18):next
  176. 1278 poke214,3:print:printtab(15)"[211] [195] [207] [210] [197] [211]"
  177. 1280 printtab(13)"[195][200][213][205]    [215]   [204]"
  178. 1281 printtab(13)"----    -   -"
  179. 1282 fori=1to3:print:print""tab(12)mm$(i)tab(20)u(i)tab(24)uu(i):next
  180. 1284 ms$(0)="":ms$(1)="[208]ress a key":ms$(2)="":gosub320
  181. 1286 jy=peek(56320):geta$:ifa$=""andjy=127then1286
  182. 1287 ifsqthensq=0:sys949:goto980
  183. 1288 pz=1-pz
  184. 1290 p=1:ifpzthenp=2
  185. 1298 goto863
  186. 1300 ms$(0)="[208]layers take turns. [212]he first one
  187. 1304 ms$(1)[178]"who cannot play without making a
  188. 1310 ms$(2)="square loses. [208]ress a key.":gosub320
  189. 1314 sd=4:gosub400
  190. 1320 jy=peek(56320):geta$:ifa$=""andjy=127then1320
  191. 1330 ms$(0)="[208]ress any key to see examples of
  192. 1340 ms$(1)[178]"what makes a square. (NULL)ress (NULL)val(NULL)(NULL)(NULL)(NULL)
  193. 1350 ms$(2)="to return to the game.":gosub320:gosub160
  194. 1360 r=int(rnd(1)*105)
  195. 1370 fori=0to3:print"[150]";
  196. 1380 poke214,y(h(r,i)):print:printtab(x(h(r,i)))ck$(1):next
  197. 1390 jy=peek(56320):geta$:ifa$=""andjy=127then1390
  198. 1400 fori=0to3
  199. 1410 poke214,y(h(r,i)):print:printtab(x(h(r,i)))ck$(0):next
  200. 1420 ifa$=chr$(13)orjy<112thenreturn
  201. 1430 goto1360
  202. 1440 :
  203. 1450 :rem quit
  204. 1460 :
  205. 1470 sys928
  206. 1480 ms$(1)="[209]uit?  [193]re you sure? (y/n)":ms$(0)="  ":ms$(2)="  ":gosub320
  207. 1490 geta$:ifa$=""then1490
  208. 1500 ifa$="y"then863
  209. 1510 sys949
  210. 1520 return
  211. 1530 print"[147]":poke53270,200
  212. 1540 a$="hello connect":fori=8to13:close2:open2,i,2:close2:ifstthen1560
  213. 1550 close15:open15,i,15,"r0:"+a$+"="+a$:input#15,er:close15:ifer=63then1570
  214. 1560 next:print"[147][146]":poke2048,0:poke44,8:poke43,1:poke53272,23:poke186,8:end
  215. 1570 poke646,peek(53281):print"[147][146]load"chr$(34)a$chr$(34)","i:poke43,1
  216. 1580 print"run":poke44,8:poke2048,0:poke631,13:poke632,13:poke198,2:end
  217. 1587 :
  218. 1588 :rem h(104,4)
  219. 1589 :
  220. 1590 data0,1,6,7,0,2,12,14,0,3,18,21,0,4,24,28,0,5,30,35
  221. 1600 data1,2,7,8,1,3,13,15,1,4,19,22,1,5,25,29
  222. 1610 data2,3,8,9,2,4,14,16,2,5,20,23
  223. 1620 data3,4,9,10,3,5,15,17
  224. 1630 data4,5,10,11
  225. 1640 data6,7,12,13,6,8,18,20,6,9,24,27,6,10,30,34
  226. 1650 data7,8,13,14,7,9,19,21,7,10,25,28,7,11,31,35
  227. 1660 data8,9,14,15,8,10,20,22,8,11,26,29
  228. 1670 data9,10,15,16,9,11,21,23
  229. 1680 data10,11,16,17
  230. 1690 data12,13,18,19,12,14,24,26,12,15,30,33
  231. 1700 data13,14,19,20,13,15,25,27,13,16,31,34
  232. 1710 data14,15,20,21,14,16,26,28,14,17,32,35
  233. 1720 data15,16,21,22,15,17,27,29
  234. 1730 data16,17,22,23
  235. 1740 data18,19,24,25,18,20,30,32
  236. 1750