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