home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1984 October
/
1984-10.d64
/
cabby_64
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
9KB
|
278 lines
5 poke53281,11:poke53280,11:printchr$(142):poke52,56:poke56,56:clr
10 print"[147]":dim a%(26),f$(26),tl%(12),t1%(12),lc%(70),cm%(26)
15 poke214,12:print:poke211,5:print"setting up ........please wait"
20 fori=1to26:readf$(i):nexti
50 poke56334,peek(56334)and254:poke1,peek(1)and251
51 fori=0to511:pokei+14336,peek(i+53248):pokei+15360,peek(i+54272):next
52 poke1,peek(1)or4:poke56334,peek(56334)or1
55 fori=1to12:readz:forj=ztoz+7:readk:pokej,k:nextj,i
100 fori=1to26:reada%(i):next:fori=1to8:readv(i):next
110 fori=1to26:ifi=1thencm%(i)=a%(i):goto150
120 cm%(i)=cm%(i-1)+a%(i)
150 next:h=1024:c=54272:s=c:ch=28:fori=1to5:readb%(i),e%(i):next
160 fori=1to12:readt1%(i):next
165 deffna(x)=int(rnd(1)*x)+1:deffnl(q)=h+40*y+x
167 deffnd(zz)=abs((zz=39)+(zz=-39)+(zz=41)+(zz=-41))
170 fori=1to5:a=fna(2):d%(i)=(a=1)-(a=2):next
175 fori=1to5:tr(i)=(d%(i)=-1)*(-e%(i))-(d%(i)=1)*(b%(i))
176 vr(i)=(tr(i)=e%(i))-(tr(i)=b%(i)):ifi>2thenvr(i)=vr(i)*40
177 ty=(vr(i)=1)*36+(vr(i)=-1)*37+(vr(i)=40)*39+(vr(i)=-40)*38:ty(i)=(-1)*ty
180 ed(i)=(tr(i)=b%(i))*(-e%(i))+(tr(i)=e%(i))*(-b%(i)):next
185 print"[147]":poke214,8:print:poke211,13:print"select a level"
187 poke214,10:print:poke211,16:print"1) easy"
189 poke214,12:print:poke211,16:print"2) hard"
190 getz$:lv=val(z$):rd=rnd(1):ifz$=""then190
191 iflv<1orlv>2then190
195 print"[147]":poke53272,(peek(53272)and240)or14
197 formc=stos+24:pokemc,0:next:pokes+24,15:pokes+5,120:pokes+6,240:hf=s+1:lf=s
200 print"[147]":gosub3005:fori=1to12:a=t1%(i):gosub3200:next
210 p%=h+81:pokep%,ch:pokep%+c,7
220 m1=0:m2=0:m3=0:m4=0:xf%=0:cf%=0:gs=1400
300 gosub1000:ifen=1then6000
310 ifxf%=0thengosub2000
320 gosub400:ifen=1then6000
330 gosub7000:gosub500:ifen=1then6000
340 gosub1000:ifen=1then6000
350 gosub5000:ifen=1then6000
360 gosub500:ifen=1then6000
390 goto300
400 fort=1to5:a=tr(t):tr(t)=tr(t)+vr(t)
410 iftr(t)=ed(t)thenvr(t)=(-1)*vr(t):gosub700:goto440
420 ifpeek(tr(t))>=36andpeek(tr(t))<=39thentr(t)=tr(t)-vr(t):goto450
430 ifpeek(tr(t))=27orpeek(tr(t))=28thenen=1:t=5:goto450
440 pokea,32:poketr(t),ty(t):poketr(t)+c,15:gosub9810:ifn4=1then450
445 gosub500:ifen=1thent=5
450 next:return
500 jv=peek(56320):jv=15-(jvand15):fr=peek(56320)and16
505 iffr=0andsh=0thengosub9600
510 dy=(jv=1)+(jv=5)+(jv=9)-(jv=6)-(jv=10)-(jv=2)
520 dx=(jv=4)+(jv=5)+(jv=6)-(jv=9)-(jv=10)-(jv=8)
525 if(dx=0anddy=0)orgs=0thenreturn
535 ch=28:ifdx<>0thench=28
540 ifdy<>0thench=27
550 zz=40*dy+dx:z=p%+zz:pk=peek(z)
555 iffnd(zz)=1and(pk=32orpk=160)then625
557 ifsh=1then800
560 cp=(pk=30)+(pk=32)*2+(pk=40)*3+(pk=41)*4+(pk=42)*5+(pk=160)*6+(pk=0)*7
570 onabs(cp)goto600,620,8000,8000,9000,625,3300
580 ifpeek(z)>=129andpeek(z)<=154then4000
590 ifpeek(z)>=36andpeek(z)<=39thenen=1:return
600 if(peek(z+c)and15)=5then620
605 goto625
620 gosub9820:pokep%,32:pokez,ch:pokez+c,7:p%=z
625 gs=gs-2:ifgs=<0thengs=0:gosub9700
630 return
700 ty=(vr(t)=1)*36+(vr(t)=-1)*37+(vr(t)=40)*39+(vr(t)=-40)*38:ty(t)=(-1)*ty
710 ed=(ed(t)=b%(t))*(-e%(t))+(ed(t)=e%(t))*(-b%(t)):ed(t)=ed
720 return
800 ifpeek(z)=30and(peek(z+c)and15)=5then620
810 ifpeek(z)<>32then625
820 goto620
1000 forll=1to12:pk=peek(tl%(ll)+c)and15
1005 ifpeek(tl%(ll))=32thenpoketl%(ll),30:poketl%(ll)+c,pk
1010 poketl%(ll)+c,pk:tl=(pk=2)*1+(pk=5)*2+(pk=7)*3
1012 gosub500:ifen=1thenll=12:goto1030
1015 gosub400:ifen=1thenll=12:goto1030
1020 gosub5000:ifen=1thenll=12:goto1030
1025 onabs(tl)gosub1040,1050,1060
1030 next:return
1040 a=fna(3):ifa=1thenpoketl%(ll)+c,5:poketl%(ll),30
1045 return
1050 a=fna(3):ifa=2thenpoketl%(ll)+c,7:poketl%(ll),30
1055 return
1060 a=fna(3):ifa=3thenpoketl%(ll)+c,2:poketl%(ll),30
1065 return
1500 fori=22to23:forj=1to37
1510 poke214,i:print:poke211,j:printchr$(32);:nextj,i:return
2000 px=fna(26):xf%=px+128
2005 gosub1500:poke214,22:print:poke211,1
2010 print"cabby, go to the ";f$(xf%-128);:pt=px:cl=0:x=1:gosub5155
2020 gosub500:return
3005 i=49152:if peek(49154)=216thensys49160:goto3030
3010 read a:if a=256 thensys49160:goto3030
3020 poke i,a:i=i+1:goto 3010
3030 poke1064,40:poke1065,41:poke1066,40:poke1067,41:fori=1064to1067:pokei+c,1:
3040 next:poke1104+c,1:poke1104,40:fori=1105to1107:pokei,32:pokei+40,32:next
3050 poke1144,40:poke1144+c,1:fori=1265to1301:pokei,32:next
3055 fori=1545to1581:pokei,32:next
3060 fori=1114to1754step40:pokei,32:pokei+10,32:pokei+20,32:next
3065 fori=1to5
3067 x=fna(38):y=fna(19):l=fnl(q)
3070 ifpeek(l)=32orpeek(l)<>160then3067
3075 pokel,42:pokel+c,7:next
3080 k=0:fori=1to26:forj=1toa%(i)
3090 x=fna(40):y=fna(19):l=fnl(q)
3100 if peek(l)=32orpeek(l)<>160then3090
3110 ifpeek(l+1)=160andpeek(l-1)=160andpeek(l+40)=160andpeek(l-40)=160then3090
3120 k=k+1:lc%(k)=l:pokel,i+128:next:next:return
3200 ifpeek(a)<>32thengosub3220
3210 tl%(i)=a:pokea,30:pokea+c,5:return
3220 forj=1to8
3230 ifpeek(a+v(j))=32thena=a+v(j):k=8
3240 next:return
3300 ifxf%<>0thenreturn
3310 pokep%,32:pokez,ch:pokez+c,7:gosub2000
3320 pokep%,ch:pokep%+c,7:pokez,160:pokez+c,1:mn=1:return
3330 m1=abs(sp-z)/10+1:pokep%,32:pokez,ch:pokez+c,7:gosub9820
3340 m2=int(fna(100*m1)/10)/100
3350 gosub1500:poke214,22:print:poke211,1
3360 print"you collect";m1;"plus tip of";m2;
3370 m3=m1+m2+m3:m1=0:m2=0:pokep%,ch:pokep%+c,7:pokez,xf%:pokez+c,1
3375 pt=px:cl=1:x=1:gosub5155
3380 poke214,23:print:poke211,1:print"you have";m3;:mn=0:xf%=0:cf%=0:return
4000 ifmn=1then3330
4005 ifcf%<>0then4500
4010 ifpeek(z)<>xf%then630
4030 iflv=2andz<>dzthen630
4050 pc=fna(26):cf%=pc+128
4200 sp=z:pokez,ch:pokez+c,7:pokep%,32:gosub9820
4210 iflv=1thenpt=pc:cl=1:gosub5155
4260 gosub1500:poke214,22:print:poke211,1
4265 print"take me to the ";f$(cf%-128);:pt=pc:cl=0:x=2:gosub5155
4280 pokep%,ch:pokep%+c,7:gosub9820:pokez,xf%:pokez+c,1
4285 ifcf%=xf%thenpokez+c,0
4290 iflv=1andxf%<>cf%thenpt=px:cl=1:gosub5155
4300 goto630
4500 ifpeek(z)<>cf%then630
4505 iflv=2andz<>dcthen630
4510 pokez,ch:pokez+c,7:pokep%,32:gosub9820
4550 m1=abs(sp-z)/10+1
4560 m2=int(fna(100*m1)/10)/100
4570 gosub1500:poke214,22:print:poke211,1
4573 print"you collect";m1;"plus tip of";m2;
4580 m3=m1+m2+m3:m1=0:m2=0
4600 poke214,23:print:poke211,1:print"you have";m3;
4650 pokep%,ch:pokep%+c,7:gosub9820:pokez,cf%:pokez+c,1
4655 iflv=1thenpt=pc:cl=1:gosub5155
4660 cf%=0:xf%=0:goto630
5000 mx=0:my=0:goto5010
5005 my=int((p%-h)/40):mx=(p%-h)-40*my:return
5010 gosub5005:ct=abs((my=6)*1+(my=13)*2):t=ct:ifct>0thengosub5050
5015 gosub5005:ct=abs((mx=10)*3+(mx=20)*4+(mx=30)*5):t=ct:ifct>0thengosub5050
5020 return
5050 ifp%>tr(ct)andvr(ct)>0then5080
5060 ifp%<tr(ct)andvr(ct)<0then5080
5070 vr(ct)=(-1)*vr(ct):gosub700
5080 b=fna(2):dn=(b=1)*(-p%)-(b=2)*(ed(ct))
5100 poketr(ct),32:formv=tr(ct)todnstepvr(ct):pk=peek(mv)
5110 ifpk>=36andpk<=39thentr(ct)=mv-vr(ct):mv=dn:next:gosub5150:return
5115 ifpk=27orpk=28thenmv=dn:next:en=1:return
5120 pokemv,ty(ct):pokemv+c,15:sh=1
5125 gosub9810:gosub500:sh=0:pokemv,32
5126 ifen=1thenmv=dn
5130 next:ifen=1thenreturn
5135 ifdn=ed(ct)thentr(ct)=ed(ct)-vr(ct):pokeed(ct),ty(ct):return
5140 tr(ct)=dn:poketr(ct),ty(ct):return
5150 poketr(ct),ty(ct):gosub500:return
5155 iflv=2thenonxgoto5160,5170
5156 forlc=cm%(pt-1)+1tocm%(pt)
5157 pokelc%(lc)+c,cl:next:return
5160 r=fna(a%(pt)):dz=lc%(cm%(pt-1)+r):pokedz+c,0:return
5170 r=fna(a%(pt)):dc=lc%(cm%(pt-1)+r):pokedc+c,0:return
6000 print"[147]":en=0:gosub9830:poke53272,21
6050 poke214,8:print:poke211,6:print"your cab lost to the trolley"
6070 poke214,10:print:poke211,15:print"game over!"
6075 poke214,12:print:poke211,8:print"you made ";m4;"[146]dollars"
6080 print"play again (y/n)"
6085 getz$:rd=rnd(1):ifz$=""or(z$<>"y"andz$<>"n")then6085
6090 ifz$="n"thenend
6095 print"[147]":restore:goto165
7000 x=fna(40):y=fna(19)
7010 ifpeek(fnl(q))<>160then7040
7030 pokefnl(q),0:pokefnl(q)+c,3
7040 return
8000 m4=m4+m3:gosub9820
8010 gosub1500:poke214,22:print:poke211,1:print"safe in depot";m4
8020 m3=0:pokep%,ch:pokep%+c,7:pokez,40:pokez+c,1:fordl=1to500:next
8025 ifm4>200then8300
8040 ifcf%<>0then8050
8041 ifxf%=0then630
8043 gosub1500:poke214,22:print:poke211,1
8045 print"cabby, go to the ";f$(xf%-128);:n4=1:gosub400:n4=0
8046 return
8050 gosub1500:poke214,22:print:poke211,1
8060 print"take me to the ";f$(cf%-128);:n4=1:gosub400:n4=0
8070 return
8300 print"[147]":poke214,8:print:poke211,9:p