home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1991 September
/
1991-09.d64
/
showdown
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
3KB
|
130 lines
0 clr
10 rem copyright 1991 - compute publications intl ltd - all rights reserved
100 dimf(2000),g(2000)
110 gosub 880
120 gosub1000
130 s = 1475:o=1274:b=1391:c=1397:m=0:w=0:f=0:g=0:u=0
140 print"[147][144]":poke 53280,12:poke53281,12
150 print" [157] [157] [157][157][157][157][157] [145][157] [145][157] "
160 print" [146][215][215][215] [146][145][157][157][157][157][157][157][215][215][215]"
170 print" [157] [157] [157] [146][215][215][146][215] [145][157] [145][157] [145][157] [157][157][157][157][157][157][157][157][146]";
180 print"[215][215][215][215][215][215][215][157][157][157][157][157][157][157][215][215][215] [215][215][215]"
190 print"[215][215][215][215][215][215][215]"
200 print" [146][215][215][215] [146]"
210 print" "
220 ifh=-1then 1190
230 v=2
240 ifv=3then v=1
250 ifi=0thenv=2
260 jo=usr(v):geta$
270 if(joand15)=1thenw=-40:goto480
280 if(joand15)=4thenw=-1:goto480
290 if(joand15)=8thenw=1:goto480
300 if(joand15)=2thenw=40:goto480
310 if(joand16)=0then goto340
320 if a$ ="@" then 610
330 goto 240
340 jo=usr(v):if(joand15)=0then goto340
350 if(joand15)=1thenw=-40:goto400
360 if(joand15)=4thenw=-1:goto400
370 if(joand15)=8thenw=1:goto400
380 if(joand15)=2thenw=40:goto400
390 goto 240
400 y=s+w:r=0:if peek(s)=215then r=r+1
410 ifpeek(y)=87thenr=r+1
420 ifpeek(s+w+w)=32thenr=r+1
430 ifr=3 then 450
440 goto 530
450 m=m+1:pokes,32:pokes+w,32:gosub560:poke s+w+w,215:s=s+w+w:v=v+1:u=u+1
460 f(u)=1:g(u)=w
470 goto 240
480 j=0:z=peek(s):y=s+w :ifpeek(y)=87thenq=87:j=j+1
490 ifpeek(y)=32thenq=32:j=j+1
500 if j=1 then 520
510 gosub 530
520 pokes,z-128:pokes+w,q+128:s=s+w:u=u+1:f(u)=0:g(u)=w:goto 240
530 print"illegal move":gosub 560
540 print" "
550 goto 240
560 rem
570 poke54296,15:poke54277,64:poke54273,162:poke54272,37
580 poke54276,17:fort=1to200:next
590 poke54276,16:fort=1to50:next
600 return
610 j=32-m:f(u+1)=-1:g(u+1)=0
620 print"[147]";j;"pegs remaining"
630 ifj>10then print"poor!":w=-1:goto700
640 ifj>7then print"satisfactory play!":w=-1:goto700
650 ifj>5then print"good!":w=4:goto700
660 ifj>3then print"great!":w=5:goto700
670 ifj>2then print"well played!":w=11:goto700
680 ifj>1then print"missed!":w=6:goto700
690 ifj>0then print"did it!":w=6:goto700
700 print"want to save? (y/n)"
710 getk$:if k$=""then710
720 if k$<>"n"andk$<>"y"then 710
730 ifk$="n" then 800
740 input"filename";n$:input"your name";m$
750 open15,8,15:open2,8,2,"@0:"+n$+",s,w"
760 print#2,m$:forv=1tou+1
770 print#2,f(v)
780 print#2,g(v):next v
790 close2:close15
800 print"want to play? (y/n)"
810 ifw<0thengoto840
820 qz=4*40:fork=qz+55336toqz+55336+w:pokek,v:v=v+1:ifv>255thenv=0
830 next k
840 get m$:if m$="" then 810
850 if m$="n"thenprint"[147]":end
860 if m$="y" thengoto 120
870 goto 840
880 jj=49152:jh=int(jj/256):jl=jj-jh*256:poke785,jl:poke786,jh
890 fork=jjtojj+67:read y:pokek,y:next
900 data 120,70,97,176,21,169,127,141
910 data 0,220,173,1,220,201,255,240
920 data 4,169,31,208,13,173,0,220
930 data 16,8,169,255,141,0,220,173
940 data 1,220,41,31,73,15,208,4
950 data 133,97,240,23,133,98,169,136
960 data 133,97,169,0,133,99,133,100
970 data 133,101,133,102,198,97,6,98
980 data 16,250,88,96
990 return
1000 print"[147]play, watch a replay (p/r)"chr$(142)
1010 getf$:iff$=""then1010
1020 iff$="p" then 1050
1030 iff$="r"then 1120
1040 goto 1010
1050 print"[147]one or two player game? (1/2)"
1060 get i$::ifi$=""then1060
1070 ifi$="1"then i=0:goto1100
1080 ifi$="2" theni=1:goto 990
1090 goto 1060
1100 h=0:print"joystick in port 2"
1110 print"press "chr$(34)"@"chr$(34)" to end":for e=1 to 900:next:return
1120 u=0:n=0:input"filename";n$
1130 open15,8,15:open2,8,2,"0:"+n$+",s,r":input#2,m$
1140 goto 1330
1150 input#2,f(u),g(u)
1160 iff(u)=-1 then u=u-1:goto1180
1170 u=u+1:goto 1150
1180 h=-1:print"[147]":goto150
1190 s=1475:ti%=200
1200 for v=0tou
1210 e=s+g(v):geta$
1220 if f(v)=0then pokes,peek(s)-128:poke e,peek(e) +128:s=s+g(v)
1230 if f(v)=1 thenpokes,32:pokee,32:pokee+g(v),215 :s=s+g(v)+g(v):gosub560
1240 ifa$="f"thenti%=ti%-50
1250 ifa$="l"thenti%=ti%+50
1260 if ti%>1000thenti%=1000
1270 if ti%<0thenti%=0
1280 fora=1toti%:next:nextv:print"by:";m$
1290 print"press space bar to continue"
1300 geta$:ifa$<>" "then 1300
1310 close2:close15
1320 restore:goto 110
1330 input#15,en,em$,et,es
1340 if en>0thenprintem$:goto 1360
1350 goto 1150
1360 close15:close2:goto 1120