home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 11
/
011.d81
/
concentration
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
4KB
|
103 lines
100 clr:restore
105 print"[147][155]"tab(18)"concentration"tab(48)"(c) 1984 matthew oldham"
110 s=54272:v=53248:pokev+33,6:pokev+32,14
112 dimx(13),cd(13),ud(4,13),sd(4,13)
115 fori=0to2:poke12288+i,0:nexti
120 fori=3to62step3:poke12288+i,15:poke12289+i,255:poke12290+i,240:nexti
130 poke2040,192:poke2041,192:pokev+21,3:pokev+27,3:pokev+39,1:pokev+40,1
135 readnl$:pl=1264
140 print"do you wish to play against the computer"
141 input"(1) or against other humans(2-10)";np
150 if np<1ornp>10then140
160 fori=1to3:readbb$:forj=1to13:gl$(i)=gl$(i)+bb$:nextj:nexti:readnm$
170 gl$(4)=gl$(3):gl$(3)=gl$(2):fori=1to4:ready(i),st(i),bl(i):nexti
175 fori=1to13:readx(i),cd(i):nexti
180 print"[147]":printnm$:fori=1to4:forj=1to4:printgl$(j):next:next
190 fori=1to4:pl=pl+121
200 forj=1to13
210 rw=int(rnd(1)*4+1):cl=int(rnd(1)*13+1)
220 ifud(rw,cl)=32then210
230 sd(i,j)=cd(cl):ud(rw,cl)=32:pokepl,cd(cl):pokepl+40,st(rw)
240 pokepl+54272,6:pokepl+54312,6:pl=pl+3
250 nextj:nexti
260 fori=1tonp
270 print"":forj=1to6:printnl$:nextj
280 print"player number ";i,"matches ";pm(i)
290 input"please choose card 1 (row,col)";ro(1),co(1)
291 ifro(1)<1orro(1)>4orco(1)<1orco(1)>13then280
295 ifsd(ro(1),co(1))=32thenprint"card gone!":goto280
300 ifx(co(1))>255thenpokev,x(co(1))-256:pokev+16,peek(v+16)or1:goto310
305 pokev,x(co(1))
310 pokev+1,y(ro(1))
315 input"please choose card 2 (row,col)";ro(2),co(2)
316 ifro(2)<1orro(2)>4orco(2)<1orco(2)>13then315
320 ifro(1)=ro(2)andco(1)=co(2)thenprint"they're the same card!":goto280
325 ifsd(ro(2),co(2))=32thenprint"card gone!":goto315
330 ifx(co(2))>255thenpokev+2,x(co(2))-256:pokev+16,peek(v+16)or2:goto340
335 pokev+2,x(co(2))
340 pokev+3,y(ro(2))
350 ifsd(ro(1),co(1))=sd(ro(2),co(2))thenpm(i)=pm(i)+1:gosub500:goto270
355 ud(ro(1),co(1))=sd(ro(1),co(1)):ud(ro(2),co(2))=sd(ro(2),co(2))
360 forj=1to2700:nextj:fork=0to3:pokev+k,0:nextk:pokev+16,0:nexti
370 ifnp=1thengosub560
380 goto260
390 ifnp=1then440
400 hs=1:fori=2tonp:ifpm(i)>pm(hs)thenhs=i:fl=0:goto410
405 ifpm(i)=pm(hs)thenfl=1
410 nexti
415 iffl=1thenprint"[147]there is a tie with ";pm(hs);" matches":goto430
420 print"[147]and the winner is player #";hs
430 print:print:fori=1tonp:print"player #";i,pm(i);" matches"
435 nexti:goto470
440 ifcm>pm(1)thenprint"[147]i win! i win! i win!"
450 ifcm<pm(1)thenprint"[147]rats! you win "
455 ifpm(1)=cmthenprint"[147]it's a tie!"
460 print"you have ";pm(1);" matches"tab(40)"and i have ";cm;" matches"
470 input"do you wish another game";an$
480 if an$="yes"oran$="y"thengoto100
490 goto63000
500 ud(ro(1),co(1))=32:ud(ro(2),co(2))=32:sd(ro(1),co(1))=32
505 forj=1to1500:nextj
510 sd(ro(2),co(2))=32:forj=1to2:el(j)=bl(ro(j))+3*co(j):nextj
520 pokes+24,15:pokes+5,65:pokes+6,136:pokes+1,57:pokes,172:pokes+4,17
525 forj=0to120step40:fork=0to2:pokeel(1)+j+k,32:nextk:nextj:pokes+4,16
530 pokes+1,40:pokes,200:pokes+4,17
535 forj=0to120step40:fork=0to2:pokeel(2)+j+k,32:nextk:nextj:pokes+4,16
540 forj=0to3:pokev+j,0:nextj:pokev+16,0
545 tm=tm+1:iftm=26then390
550 return
560 print"":forj=1to6:printnl$:nextj:print"my turn",cm;" matches"
565 fl=fl+1:iffl/2=int(fl/2)orpm(1)>11thengoto670
570 ro(1)=int(rnd(1)*4+1):co(1)=int(rnd(1)*13+1)
575 ifsd(ro(1),co(1))=32then570
580 ro(2)=int(rnd(1)*4+1):co(2)=int(rnd(1)*13+1)
590 ifro(1)=ro(2)andco(1)=co(2)then580
600 ifsd(ro(2),co(2))=32then580
610 ifx(co(1))>255thenpokev,x(co(1))-256:pokev+16,peek(v+16)or1:goto620
615 pokev,x(co(1))
620 ifx(co(2))>255thenpokev+2,x(co(2))-256:pokev+16,peek(v+16)or2:goto630
625 pokev+2,x(co(2))
630 pokev+1,y(ro(1)):pokev+3,y(ro(2))
640 ifsd(ro(1),co(1))=sd(ro(2),co(2))thencm=cm+1:gosub500:goto560
645 ud(ro(1),co(1))=sd(ro(1),co(1)):ud(ro(2),co(2))=sd(ro(2),co(2))
650 forj=1to2700:nextj:fork=0to3:pokev+k,0:nextk:pokev+16,0
660 return
670 ro(1)=int(rnd(1)*4+1):co(1)=int(rnd(1)*13+1)
680 ifsd(ro(1),co(1))=32then670
690 forj=1to4:fork=1to13
700 ifro(1)=jandco(1)=kthen720
710 if sd(ro(1),co(1))=ud(j,k)thenro(2)=j:co(2)=k:goto610
720 nextk:nextj
730 ro(2)=int(rnd(1)*4+1):co(2)=int(rnd(1)*13+1)
740 ifsd(ro(2),co(2))=32then730
750 ifro(1)=ro(2)andco(1)=co(2)then730
760 goto610
770 data" ","[213][195][201]","[194] [194]","[202][195][203]"
775 data" 1 2 3 4 5 6 7 8 9 10 11 12 13"
780 data119,65,1341,151,83,1501,183,88,1661,215,90,1821
790 data24,1,48,11,72,17,96,10,120,20,144,57,168,56,192,55
800 data216,54,240,53,264,52,288,51,312,50
63000 rem return to loadstar
63010 print"[147]load"chr$(34)"payload"chr$(34)",8":print"run"
63020 poke631,13:poke632,13:poke198,2:end