home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Commodore Disk User Volume 1 #3
/
Commodore_Disk_User_Vol.1_3_1988_-.d64
/
maze
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
3KB
|
127 lines
100 print"[147] *** micro-maze ***"
110 print"in this game,you have to make your way"
120 print"through a maze,but the screen will show"
130 print"the view from inside the maze,instead of";
140 print"from above it. you can turn left,right,"
150 print"go straight on or backwards at each"
160 print"junction,by typing l,r,f(forwards) or b.";
170 print"if you want to see the maze from above"
180 print"type 'h',but each time you do this your"
190 print"score will lessen."
200 print" press any key to start"
210 geta$:ifa$=""then210
215 poke53280,0
220 print"[147]":poke53281,0:dima(8,8),c$(15),d(4),e(4),t(3),l(15),r(15)
225 a=0:b=0:c=0
230 forx=1to8:fory=1to8:reada(x,y):next:next
240 forx=0to15:readr(x),l(x):next
250 forx=1to4:readd(x),e(x):next
260 forx=0to15:fory=1to3:readc$:c$(x)=c$(x)+c$:ify<3thenc$(x)=c$(x)+"[157][157][157]"
270 next:next
300 h=0:n=0:px=1:py=1:rx=8:ry=8:d=1
310 gosub2000:gosub4000
320 ifpx<>rxorpy<>rythenn=n+1:goto310
330 print"[147]amaze[146]ing!":print"you've done it!"
340 print"your score is";
344 s=50-h*2-n
345 print-(s>0)*s;"out of 25."
350 end
1000 a=1073:b=1913:c=21:gosub9000
1010 a=1278:b=1718:c=11:gosub9000
1020 ife>1thena=1401:b=1601:c=5:gosub9000
1030 ife>2thena=1442:b=1562:c=3:gosub9000
1040 return
2000 print"[147]"
2010 gosub5000:gosub1000
2020 forx=1toe:i=t(x):j=iand1:k=iand2:l=iand4
2030 ifjthengosub2200
2040 ifkthengosub2100
2050 iflthengosub2300
2060 ifj=0thengosub2400
2070 ifl=0thengosub2500
2080 nextx
2090 return
2100 onxgoto2110,2120,2130
2110 a=1239:b=1248:c=520:goto6000
2120 a=1362:b=1365:c=280:goto6000
2130 a=1403:b=1404:c=200:goto6000
2200 onxgoto2210,2220,2230
2210 a=1074:b=1238:gosub7000:a=1758:b=1914:goto8000
2220 a=1279:b=1361:gosub7000:a=1641:b=1719:goto8000
2230 poke1402,77:poke1602,78:return
2300 onxgoto2310,2320,2330
2310 a=1093:b=1249:gosub8000:a=1769:b=1933:goto7000
2320 a=1288:b=1366:gosub8000:a=1646:b=1728:goto7000
2330 poke1405,78:poke1605,77:return
2400 onxgoto2410,2420,2430
2410 a=1234:b=1238:c=520:goto6000
2420 a=1359:b=1361:c=280:goto6000
2430 poke1402,100:poke1602,99:return
2500 onxgoto2510,2520,2530
2510 a=1249:b=1253:c=520:goto6000
2520 a=1366:b=1368:c=280:goto6000
2530 poke1405,100:poke1605,99:return
3000 forx=1to8:fory=1to8:q=a(x,y)
3010 printc$(q)"[145][145]";
3020 next:print"":next:h=h+1
3030 poke1065+(py-1)*3+(px-1)*120,42
3040 poke1065+(ry-1)*3+(rx-1)*120,134
3050 geta$:ifa$=""then3050
3060 print"[147]":return
4000 print"type your move:"
4010 geta$:ifa$=""then4010
4020 ifa$="h"thenprint"[147]";:gosub3000:gosub2010:goto4000
4030 ifa$="f"and(t(1)and2)=0then4080
4040 ifa$="b"and(t(1)and8)=0then4110
4050 ifa$="l"and(t(1)and1)=0then4130
4060 ifa$="r"and(t(1)and4)=0then4150
4065 ifa$=""thenprint"[147]":end
4070 goto4010
4080 pm=px:pn=py:px=px+d(d):py=py+e(d)
4090 ifpx<1orpx>8orpy<1orpy>8thenpx=pm:py=pn:goto4010
4100 return
4110 d=d+2:ifd>4thend=d-4
4120 goto4080
4130 d=d-1:ifd=0thend=4
4140 goto4080
4150 d=d+1:ifd=5thend=1
4160 goto4080
5000 x=px:y=py:t(1)=a(x,y):e=1
5010 e=e+1:x=x+d(d):y=y+e(d):ifx<1orx>8ory<1ory>8thene=e-1:goto5040
5020 e=e+1:t(2)=a(x,y):x=x+d(d):y=y+e(d):ifx<1orx>8ory<1ory>8thene=e-1:goto5040
5030 t(3)=a(x,y)
5040 forx=1toe
5050 ifd<3thent(x)=r(t(x))
5060 ifd=3thent(x)=l(t(x))
5070 ifd=2thent(x)=r(t(x))
5080 next:forx=1toe
5090 if(t(x)and2)>0thene=x:return
5100 next:return
6000 fory=atob:pokey,100:pokey+c,99:next:return
7000 fory=atobstep41:pokey,77:next:return
8000 fory=atobstep39:pokey,78:next:return
9000 fory=atobstep40:pokey,103:pokey+c,101:next:return
9500 data11,2,6,3,10,14,7,7,3,4,1,0,2,10,8,4
9510 data5,13,5,13,1,14,11,12,9,6,9,14,9,6,3,14
9520 data3,4,3,6,3,8,8,6,9,12,5,9,8,10,10,12
9530 data3,2,12,3,2,10,2,6,13,9,10,12,9,14,13,13
9540 data0,0,8,2,1,4,9,6,2,8,10,10,3,12,11,14,4,1,12,3,5,5
9550 data13,7,6,9,14,11,7,13,15,15
9560 data0,1,1,0,0,-1,-1,0
9570 data"[166] [166]"," ","[166] [166]"
9580 data"[166] [166]","[166] ","[166] [166]"
9590 data"[166][166][166]"," ","[166] [166]"
9600 data"[166][166][166]","[166] ","[166] [166]"
9610 data"[166] [166]"," [166]","[166] [166]"
9620 data"[166] [166]","[166] [166]","[166] [166]"
9630 data"[166][166][166]"," [166]","[166] [166]"
9640 data"[166][166][166]","[166] [166]","[166] [166]"
9650 data"[166] [166]"," ","[166][166][166]"
9660 data"[166] [166]","[166] ","[166][166][166]"
9670 data"[166][166][166]"," ","[166][166][166]"
9680 data"[166][166][166]","[166] ","[166][166][166]"
9690 data"[166] [166]"," [166]","[166][166][166]"
9700 data"[166] [166]","[166] [166]","[166][166][166]"
9710 data"[166][166][166]"," [166]","[166][166][166]"
9720 data"[166][166][166]","[166] [166]","[166][166][166]"