start tok64 d64-DW296X 5 SYS 12307 10 REM * clear screen and set background and border colours 20 PRINT"{black}{clear}":POKE53280,6:POKE53281,7 30 POKE53272,21 40 PRINT"{down*9}" 50 PRINT"{space*14}********** 60 PRINT"{space*13}** {reverse on} maze {reverse off} ** 70 PRINT"{space*14}********** 80 PRINT 90 PRINT 100 PRINT 110 PRINT"{down*5}{right*2}{space*7}tryck valfri tangent !" 115 POKE198,0 120 GET a$:IFa$=""THEN120 130 PRINT"{clear}" 150 PRINT"{space*14}{reverse on} maze {reverse off} 160 PRINT"{down*2}du har blivit{right}insta{up}{left}{cm p}{down}ngd i en labyrint." 170 PRINT"{down}ditt uppdrag a{up}{left}{cm p}{down}r att ta dig ut pa{up}{left}.{down} minsta {down}mo{up}{left}{cm p}{down}jliga tid." 180 PRINT 190 PRINT 200 PRINT"styr fyrkanten ({cm d} ) med fo{up}{left}{cm p}{down}ljande{space*4}{down}{space*4}tangenter:" 210 PRINT"{down}'p' = upp{space*11}'.' = ner" 220 PRINT"{down}'l' = va{up}{left}{cm p}{down}nster","'[' = ho{up}{left}{cm p}{down}ger" 230 PRINT:PRINT 240 PRINTSPC(12)"{reverse on}lycka till!{reverse off}" 250 PRINT 260 PRINT"{right} {right}{space*4}tryck valfri tangent !" 265 FORt=1TO300:NEXT:POKE198,0 270 GET a$:IFa$=""THEN270 280 PRINT"{clear}" 290 PRINT"{reverse on}{clear}{down*3}f1{reverse off}{space*3}spela maze" 300 PRINT"{reverse on}{down}f3{reverse off}{space*3}ladda na{up}{left}{cm p}{down}sta program" 310 PRINT"{down}tryck {reverse on}f1{reverse off} eller {reverse on}f3{reverse off} !" 320 GETa$:IFa$="{f1}"THEN350 330 IFa$="{f3}"THENPRINT"{clear}{down}tryck play pa{up}{left}.{down} bandspelaren{yellow}":LOAD 340 GOTO320 350 DIMw(38,22),v(38,22),d(8):REM * arrays for maze 360 x=RND(-ti) 370 h=10:v=11 380 PRINT"{down*3}vill du ha en liten, medel eller stor {down}{space*2}labyrint ?{space*2}(l,m,s)" 390 GETa$:IFa$=""THEN390 400 x=ASC(a$):IFx=76GOTO440 410 IFx=77THENh=15:v=11:GOTO440 420 IFx=83THENh=19:v=11:GOTO440 430 GOTO390 440 x=200:FORi=1TOh:w(i,0)=x:NEXTi 450 FORi=1TOv:w(0,i)=x:w(h+1,i)=x:NEXTi 460 PRINT"{down*2}vill du se na{up}{left}{cm p}{down}r jag konstruerar{space*5}{down}{space*5}labyrinten ? (j/n)" 470 GETa$:IFa$=""THEN470 480 f=0:IFASC(a$)<>74THENf=1 490 z=INT(RND(1)*h+1) 500 PRINT"{clear}":PRINT" ";:FORi=1TOh:REM prints maze 510 :a$="{cm p*2}":IFi=zTHENa$="{space*2}" 520 :PRINTa$;:NEXTi 530 PRINT 540 :FORj=1TOv:PRINT"{cm m}"; 550 : FORi=1TOh:PRINT" {cm m}";:NEXTi 560 :PRINT:PRINT"{cm m}"; 570 FORi=1TOh:PRINT"{cm p}{sh @}";:NEXTi:PRINT:NEXTj 580 w(z,1)=1:c=2:r=z:s=1:GOTO 630 590 IFr<>hTHENr=r+1:GOTO 620 600 r=1:IFs<>vTHENs=s+1:GOTO 620 610 s=1:GOTO 620 620 IFw(r,s)=0GOTO 590 630 FORj=1TO4:d(j)=0:NEXTj 640 d(1)=w(r-1,s)=0 650 d(2)=w(r,s-1)=0 660 d(3)=w(r+1,s)=0 670 d(4)=w(r,s+1)=0AND(c>v*h/2ORsvANDc1GOTO890 880 PRINT"{home}{down*2}";:FORs=1TOv:PRINT"{right}";:FORr=1TOh:GOSUB1200:NEXTr:PRINT:PRINT:NEXTs 890 r=z:s=1:GETa$:GETa$:GETa$ 900 ti$="{0*6}":REM set clock 910 r1=r:s1=s:a$="{cm d}":GOSUB1140 920 PRINT"{home}{reverse on}";ti$ 930 d=PEEK(197):IFd=64 THEN 920:REM get key press and direction 940 IFd=44GOTO 1010 950 IFd=42GOTO 1030 960 IFd=50GOTO 1060 970 IFd<>41GOTO 920 980 IFs=1GOTO 920 990 IFABS(v(r,s-1)-1)=1GOTO 920 1000 s=s-1:GOTO 1080 1010 IFABS(v(r,s)-1)=1GOTO 920 1020 s=s+1:GOTO 1080 1030 IFr=1GOTO 920 1040 IFv(r-1,s)<2GOTO 920 1050 r=r-1:GOTO 1080 1060 IFv(r,s)<2GOTO 920 1070 r=r+1 1080 a$=" ":GOSUB1140 1090 IFs<=vGOTO 910 1100 PRINT"{home}{right*7}{reverse on}bra gjort !":REM exit routine 1110 FORj=1TO1000:NEXT 1120 GETz$:IFz$<>""GOTO1120 1130 PRINT"{down*19}":RUN 1140 PRINT"{home}" 1150 FORj=1TOs1*2-1:PRINT:NEXT 1160 FORj=1TOr1:PRINT"{right*2}";:NEXTj:PRINT"{left}";a$:RETURN 1170 IFf=1THENRETURN 1180 PRINT"{home}":FORj=1TOs*2-1:PRINT:NEXTj 1190 FORj=1TOr:PRINT"{right*2}";:NEXTj:PRINT"{left}"; 1200 a$="{space*2}":x=v(r,s):IFx<2THENa$=" {cm m}" 1210 PRINTa$;"{left*2}{down}";:a$="{space*2}":IFx=2THENa$="{cm p*2}" 1220 IFx=0THENa$="{cm p}{sh @}" 1230 IFx=1THENa$=" {cm m}" 1240 PRINTa$;"{up}";:RETURN stop tok64 (bastext 1.0)