home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 79 / 079.d81 / tictactoomuch (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  9KB  |  272 lines

  1. 0 gosub2000:poke787,0
  2. 1 sys57812"screen",8,0:poke780,0:poke781,0:poke782,192:sys65493
  3. 2 sys57812"tttm.fnt",8,0:poke780,0:poke781,0:poke782,56:sys65493
  4. 3 sys57812"mrj40192",8,0:poke780,0:poke781,0:poke782,157:sys65493
  5. 4 poke56,56:poke52,56:clr
  6. 5 sys40192,chr$(13)+"[145][157]",10,10,10,10
  7. 6 rr(1)=1:rr(2)=1:rf(1)=1:rf(2)=1:rd(1)=1:rd(2)=1:ra(1)=1:ra(2)=1:sw=53272
  8. 10 dimmo(16):gosub9000:pokesw,31:gosub1000
  9. 100 sq=1:x%=rnd(1)*20+30:forlo=0tox%:co=1:print""spc(15)"[158]moves:"lo"[157] "
  10. 101 iflo=x%thengosub385:goto125
  11. 102 iflo=30thenpoke53280,9:poke214,22:print:printspc(25)"[153]last turn"
  12. 103 printdd$d$(co)
  13. 104 poke198,0:poke646,1
  14. 105 getaa$:ifaa$<>""andaa$<>"[157]"andaa$<>"q"andaa$<>chr$(13)andaa$<>"h"then105
  15. 106 gosub700:ifaa$=""thenco=co+1:ifco=5thenco=1
  16. 107 ifaa$="[157]"thenco=co-1:ifco=0thenco=4
  17. 108 ifaa$="q"thengosub1600:goto104
  18. 109 ifaa$=chr$(13)thengosub702:goto120
  19. 110 printdd$d$(co)
  20. 111 ifaa$="h"thengosub3000
  21. 115 goto104
  22. 120 oncogosub200,300,401,500:nextlo
  23. 125 gosub700:gosub701:j=3:gosub703:gosub700
  24. 130 printdd$"[155]        checking for the winner       ":w$="one"
  25. 131 forn=1to9:ck(n)=peek(pp(n)+1):ifck(n)=253thenp(1)=p(1)+1
  26. 132 ifck(n)=252thenp(2)=p(2)+1
  27. 133 next
  28. 135 x=253:fork=1to2:y=1:z=3:forn=1to3:forr=ytoz:ifck(r)=xthensf=sf+1
  29. 136 next:ifsf=3thenp(k)=p(k)+5
  30. 137 sf=0:y=y+3:z=z+3:next:x=252:next
  31. 138 x=253:fork=1to2:y=1:z=7:forn=1to3:forr=ytozstep3:ifck(r)=xthensf=sf+1
  32. 139 next:ifsf=3thenp(k)=p(k)+5
  33. 140 sf=0:y=y+1:z=z+1:next:x=252:next
  34. 141 if(ck(1)=253andck(5)=253andck(9)=253)orck(3)=253andck(5)=253andck(7)=253then180
  35. 142 if(ck(1)=252andck(5)=252andck(9)=252)orck(3)=252andck(5)=252andck(7)=252then182
  36. 145 p(1)=p(1)+9-zz:p(2)=p(2)+9-zy
  37. 148 ifp(2)>p(1)thenw$="two"
  38. 149 ifp(1)=p(2)thenprintdd$"[158]      the cat gets it this time        ":goto155
  39. 150 printdd$"                                       "
  40. 151 printdd$"[158]      the winner is player "w$
  41. 155 poke214,23:print:print" [158]return or fire - play again   q - quit[146]"
  42. 156 poke198,0
  43. 157 getaa$:ifaa$<>chr$(13)andaa$<>"q"then157
  44. 159 ifaa$="q"thengosub1600
  45. 160 run6
  46. 180 p(1)=p(1)+10:goto145
  47. 182 p(2)=p(2)+10:goto145
  48. 200 fork=1to4:next:poke198,0:j=4
  49. 201 geta$
  50. 202 ifa$="[145]"thenifsq>3thenpokepp(sq),32:sq=sq-3:gosub703
  51. 203 ifa$=""thenifsq<7thenpokepp(sq),32:sq=sq+3:gosub703
  52. 204 ifa$=""thenifsq<9thenpokepp(sq),32:sq=sq+1:gosub703
  53. 206 ifa$="[157]"thenifsq>1thenpokepp(sq),32:sq=sq-1:gosub703
  54. 208 ifa$=chr$(13)thengosub218:gosub1100:return:rem fire
  55. 210 pokepp(sq),62:pokepp(sq)+c,1
  56. 215 goto201
  57. 218 gosub702:pokepp(sq),32:ifzz=8andpl=1thenreturn
  58. 219 ifzy=8andpl=2thenreturn
  59. 220 x=pp(sq)+1:x=x-1024:ro=int(x/40):cl=x-40*ro:poke214,ro-2:print
  60. 221 printspc(cl)pl$(pl)
  61. 223 ifpl=1thenzz=zz+1:pokemo(zz),32
  62. 224 ifpl=2thenzy=zy+1:pokemo(zy+8),32
  63. 225 return
  64. 300 s%=rnd(1)*48+16:ol%=s%/8:ll=s%-ol%*8:forl=1tool:
  65. 305 forn=1to8:pokecs(n),62:pokecs(n)+c,1:gosub705:pokecs(n),32:next:next
  66. 310 forn=1toll:pokecs(n),62:pokecs(n)+c,1:gosub705:pokecs(n),32:next
  67. 311 ifn=8andlo<30thenn=int(rnd(0)*8)
  68. 315 pokecs(n),62:onngosub350,351,352,353,330,355,369,385:forr=1to1000:next
  69. 320 fg=0:gosub1100:pokecs(n),32:return
  70. 330 printdd$"[156]  which option:  [210][193]  [210][210]  [210][198]  [210][196]  [206][207][206][197]":co=1:poke198,0
  71. 331 geta$
  72. 332 ifa$=""thenpokeop(co),32:co=co+1:ifco>5thenco=1
  73. 333 ifa$="[157]"thenpokeop(co),32:co=co-1:ifco<1thenco=5
  74. 334 pokeop(co),62:pokeop(co)+c,1
  75. 335 ifa$<>""thengosub700
  76. 336 ifa$=chr$(13)thengosub702:goto340
  77. 337 goto331
  78. 340 fg=1:gosub1120
  79. 341 te=1:oncogosub371,374,377,380:ifte=1thengosub1120
  80. 345 return
  81. 350 ra(pl)=ra(pl)+1:return
  82. 351 rr(pl)=rr(pl)+1:return
  83. 352 rf(pl)=rf(pl)+1:return
  84. 353 rd(pl)=rd(pl)+1:return
  85. 355 printdd$"[156]  which option:  [210][193]  [210][210]  [210][198]  [210][196]  [206][207][206][197]":co=1
  86. 356 poke198,0
  87. 357 geta$
  88. 360 ifa$=""thenpokeop(co),32:co=co+1:ifco>5thenco=1
  89. 361 ifa$="[157]"thenpokeop(co),32:co=co-1:ifco<1thenco=5
  90. 362 pokeop(co),62:pokeop(co)+c,1:ifpo=1anda$=chr$(13)thenreturn
  91. 363 ifa$<>""thengosub700
  92. 364 ifa$=chr$(13)thengosub702:goto368
  93. 365 goto357
  94. 368 fg=1:oncogosub370,373,376,379,390:gosub1120
  95. 369 return
  96. 370 ifra(pl)=0thengosub390:gosub1120:return
  97. 371 ifra(pl)>0thenra(pl)=ra(pl)-1:gosub1120:ra(pl)=ra(pl)+1:te=0
  98. 372 return
  99. 373 ifrr(pl)=0thengosub390:gosub1120:return
  100. 374 ifrr(pl)>0thenrr(pl)=rr(pl)-1:gosub1120:rr(pl)=rr(pl)+1:te=0
  101. 375 return
  102. 376 ifrf(pl)=0thengosub390:gosub1120:return
  103. 377 ifrf(pl)>0thenrf(pl)=rf(pl)-1:gosub1120:rf(pl)=rf(pl)+1:te=0
  104. 378 return
  105. 379 ifrd(pl)=0thengosub390:gosub1120:return
  106. 380 ifrd(pl)>0thenrd(pl)=rd(pl)-1:gosub1120:rd(pl)=rd(pl)+1:te=0
  107. 381 return
  108. 385 lo=x%+1:poke53280,0:return
  109. 390 ra(pl)=0:rr(pl)=0:rf(pl)=0:rd(pl)=0:ifco=5thengosub1120
  110. 391 return
  111. 401 gosub1100:return
  112. 500 printdd$"[156]  which option:  [210][193]  [210][210]  [210][198]  [210][196]  [206][207][206][197]":co=1:poke198,0
  113. 501 geta$
  114. 502 ifa$=""thenpokeop(co),32:co=co+1:ifco>5thenco=1
  115. 503 ifa$="[157]"thenpokeop(co),32:co=co-1:ifco<1thenco=5
  116. 504 pokeop(co),62:pokeop(co)+c,1
  117. 505 ifa$<>""thengosub700
  118. 506 ifa$=chr$(13)thengosub702:goto509
  119. 507 goto501
  120. 509 forr=1to500:next:oncogosub515,520,535,555
  121. 510 forr=1to500:next:gosub1100:return
  122. 515 ifra(pl)=0thenreturn
  123. 516 fornn=1to9:gosub590:next:ra(pl)=ra(pl)-1:return
  124. 520 sq=1:ifrr(pl)=0thenreturn
  125. 521 poke198,0
  126. 522 geta$
  127. 525 ifa$="[145]"thenifsq>3thenpokepp(sq),32:sq=sq-3
  128. 526 ifa$=""thenifsq<7thenpokepp(sq),32:sq=sq+3
  129. 527 ifa$=chr$(13)then530
  130. 528 pokepp(sq),62:pokepp(sq)+c,1
  131. 529 goto522
  132. 530 fornn=sqtosq+2:gosub590:next:rr(pl)=rr(pl)-1:return
  133. 535 sq=7:ifrf(pl)=0thenreturn
  134. 536 poke198,0
  135. 537 geta$
  136. 541 ifa$=""thenifsq<9thenpokepp(sq)+41,32:sq=sq+1
  137. 542 ifa$="[157]"thenifsq>7thenpokepp(sq)+41,32:sq=sq-1
  138. 543 pokepp(sq)+41,30:pokepp(sq)+41+c,1:ifa$=chr$(13)then545
  139. 544 goto537
  140. 545 fornn=sqtosq-6step-3:gosub590:next:pokepp(sq)+41,32:rf(pl)=rf(pl)-1:return
  141. 555 sq=1:sh=27:dv=80:ifrd(pl)=0thenreturn
  142. 556 poke198,0
  143. 557 geta$
  144. 561 ifa$=""thenifsq=1thenpokepp(sq)-80,32:sq=3:sh=29:dv=77
  145. 562 ifa$="[157]"thenifsq=3thenpokepp(sq)-77,32:sq=1:sh=27:dv=80
  146. 563 pokepp(sq)-dv,sh:pokepp(sq)-dv+c,1:ifa$=chr$(13)then565
  147. 564 goto557
  148. 565 rd(pl)=rd(pl)-1:poke1116,32:poke1131,32:ifsq=3then570
  149. 566 fornn=1to9step4:gosub590:next:return
  150. 570 fornn=3to7step2:gosub590:next:return
  151. 590 ifpeek(pp(nn)-39)=251thensh=2:x=pp(nn):gosub595:goto593
  152. 591 ifpeek(pp(nn)-39)=250thensh=1:x=pp(nn):gosub595:goto593
  153. 592 ifpeek(pp(nn)-39)<>32thenstop
  154. 593 pokepp(sq),32:return
  155. 595 x=x-1024:ro=int(x/40):cl=x-40*ro:poke214,ro-2:print
  156. 596 printspc(cl+1)pl$(sh):return
  157. 700 pokec+1,co*10:forz=1to100:next:pokec+1,0:return
  158. 701 pokec+1,pl*20:forz=1to500:next:pokec+1,0:return
  159. 702 pokec+1,4:forz=1to50:next:pokec+1,0:return
  160. 703 pokec+1,j*10:forz=1to100:next:pokec+1,0:return
  161. 705 pokec+1,n*10:forz=1to50:next:pokec+1,0:return
  162. 706 pokec+1,asc(g$):forz=1to20:next:pokec+1,0:return
  163. 1000 a$="[155]                 [191]    [191]
  164. 1001 b$[178]"list             loglogloglog(NULL)loglogloglog(NULL)loglogloglog"
  165. 1002 c$(1)[178]"printreverse all         take option
  166. 1003 c$(2)="reverse rank [188]      lose option
  167. 1004 c$(3)[178]"reverse file sin      lose turn
  168. 1005 c$(4)="reverse diag /      random                    [158]h - help  q - quit[146]"
  169. 1006 dd$=""
  170. 1007 poke53280,0:poke53281,0:print"[147]            tic tac too much"
  171. 1008 pl$(1)="[150][187][186][157][157][189][188]":pl(1)=24:c=54272:forn=ctoc+24:poken,0:next:pokec+24,15
  172. 1009 pl$(2)="[154][186][187][157][157][188][189]":pl(2)=15:pokec+5,255:pokec+6,255:pokec+4,17
  173. 1010 forn=1to3:printa$:next:printb$:forn=1to3:printa$:next:printb$:forn=1to3
  174. 1011 printa$:next:print:printd$(0):print"[158] [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][192][192]"
  175. 1012 ifpeek(787)<>1thenpoke787,1:goto1500:rem restart without titles
  176. 1015 forn=1to4:printspc(5)c$(n):print:next
  177. 1020 print"[150]  player"spc(23)"[154]player":print"[150]    one"spc(25)"[154]two"
  178. 1021 forn=1to4:printspc(7)"xx"spc(21)"[154]oo":next
  179. 1022 p$(1)="one[146][154]two"
  180. 1023 p$(2)="[150]onetwo[146]"
  181. 1025 gosub1100
  182. 1030 d$(1)="  place[146]   spin    pass    play optio