home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
64'er
/
64ER_CD.iso
/
89xx
/
8902c.d64
/
labyrinth
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
1995-03-30
|
7KB
|
216 lines
0 REM@ \INTEGER #
1 REM@ \WORD A,B,C,X,P,TC,BC,DW:\BYTE CO,Z,Y
2 POKE53281,0:POKE53280,6
3 S=54272:GOSUB7000:GOSUB9000
4 VP=54272:CO=1
5 GOTO900
9 REM@ \FASTFOR
10 Y=PEEK(TC-U):Z=PEEK(TC-U+LL):IFABS(U)=1ORDC=0THEN30
20 IFY=32ANDZ=32THENFORA=TC-U+LLTOBC-V-LLSTEP40:POKEA,W3:POKEA+VP,CO:NEXT
30 POKETC,TW:POKEBC,BW:POKETC+VP,CO:POKEBC+VP,CO
31 B=B+1:IFB<DWTHENTC=TC+U:BC=BC+V:GOTO30
40 IFABS(U)=1THENPOKETC,T1:POKEBC,B1:POKETC+VP,CO:POKEBC+VP,CO
50 IFTC=BC-LLTHENRETURN
60 FORB=TC+LLTOBC-LLSTEP40:POKEB,SW:POKEB+VP,5:NEXT:RETURN
65 DW=INT(DV/3)+1
70 F=ML:U=LL+1:V=1-LL:T1=80:B1=122:SW=103
80 FORX=4TO6STEP2:TW=77:BW=78:B=0:IFX=4THEN100
90 F=MR:U=LL-1:V=-LL-1:SW=101:T1=79:B1=76:TW=78:BW=77
100 LM=M(F):LD=W(F)
101 IFF=3ANDOP=ECTHEN140
104 IFLD=0THENLD=2
105 IFQ-LD*INT(Q/LD)=0THENTC=M(X):BC=M(X+1):GOSUB10:GOTO130
110 TW=99:BW=100:U=U-LL:V=V+LL:N=PEEK(OP+LM)
120 IFN-D*INT(N/D)=0THENTC=M(X)+DW*LL:BC=M(X+1)+DW*-LL:GOSUB10
130 IFABS(U)=1THENU=U+LL:V=V-LL
140 M(X)=M(X)+DW*U:M(X+1)=M(X+1)+DW*V:NEXT
150 IFM=3ANDOP=ECTHENRETURN
160 IFQ-D*INT(Q/D)=0THEN180
170 OP=OP+M(M):Q=PEEK(OP):DC=DC+1
172 IFDC>=CDTHENRETURN
173 ZX=ZX+1
174 DW=DV-ZX+1:GOTO70
175 IFDC=CDTHENRETURN
180 R=PEEK(M(4)-1)
185 IFR=32THENM(4)=M(4)-1:M(5)=M(5)-1:IFM(4)<>TL+DW*LLTHEN180
190 R=PEEK(M(6)+1)
195 IFR=32THENM(6)=M(6)+1:M(7)=M(7)+1:IFM(6)<>TR+DW*LLTHEN190
200 WK=1:FORTC=M(4)TOM(6):POKETC,W1:POKETC+VP,CO:NEXT
210 FORBC=M(5)TOM(7):POKEBC,W2:POKEBC+VP,CO:NEXT:RETURN
240 CX=ZX:ZX=0:GK=WK:WK=0
241 REM@ \SLOWFOR
242 FORI=0TO10:GETA$:NEXT
243 PRINT"O2:"OX"[157] "
245 GOSUB15000
247 IFA$="P"THENGOSUB5000 :GOTO245
250 NP=P:Q=PEEK(P):IFA$="G"THENNP=P+M(M)
260 IFNP=PTHEN320
270 IFTT=1ANDCX=0ANDGK=0THENGOSUB6000:GOSUB4000:RUN
285 IFQ-D*INT(Q/D)<>0THENP=NP:GOTO380
305 POKES+13,15*16+12:POKES+7,90:POKES+8,4:POKES+11,129:POKES+11,128
320 NM=M:IFA$="R"THENNM=M+1
330 IFA$="O"THENNM=M+2
340 IFA$="L"THENNM=M+3
345 IFA$="K"THENGOSUB600:POKE198,0:WAIT198,1:POKE198,0:GOTO360
350 IFNM=MTHEN242
360 IFNM>3THENNM=NM-4*INT(NM/4)
370 M=NM
380 D=W(M):Q=PEEK(P):OP=P:ML=M-1:MR=M+1
390 IFML+30000<30000THENML=3
400 IFMR>3THENMR=0
410 OX=OX-OL
415 IFOX+30000<30000THENPRINT"LUFT VERBRAUCHT!":GOSUB6800:GOSUB4000:RUN
420 T=T+1:TT=1
430 IFTT=1THENDC=0:GOSUB2000:GOSUB65
440 M(4)=TL:M(5)=BL:M(6)=TR:M(7)=BR:GOTO240
500 P=P+1:IFP>EMTHENP=SM
510 A=INT(RND(1)*4):DC=0
520 A=A+1:DC=DC+1:IFDC>3THEN500
530 IFA>3THENA=0
540 M=P+M(A):IFM<SMORM>EMTHEN520
550 CP=PEEK(P):CM=PEEK(M):IFC+10000>10000ANDCP=210THENP=M:GOTO510
560 TM=M-SM:IF(CP=CMORCM<210)ANDC+10000>10000THEN520
570 ME=TM-L*INT(TM/L):IF(ME=0ANDM(A)=1)OR(ME=GANDM(A)=-1)THEN520
580 OD=INT(15/W(A)):CP=CP/W(A):POKEP,CP:CM=CM/OD:POKEM,CM
590 PRINTTAB(17);H-C"[157] [145]"
594 P=M:C=C+1:IFC<HTHEN510
595 RETURN
600 GOSUB2000
602 REM@ \FASTFOR
605 A=1025+LL:MS=A:DC=SM:DD=SM+G
610 FORB=DCTODD:FORC=0TO3:CB=PEEK(B):CB=CB-W(C)*INT(CB/W(C))
620 AA=1:IFC=1ORC=3THENAA=LL
630 IFC>1THENAA=-AA
640 BB=LL/AA:P2=A+AA:P1=P2+BB:P3=P2-BB
645 IFB=PTHENPOKEA,W4:POKEA+VP,CO
650 IFCB=0THENPOKEP1,W3:POKEP2,W3:POKEP3,W3
651 IFCB=0THENPOKEP1+VP,CO:POKEP2+VP,CO:POKEP3+VP,CO
660 NEXT:A=A+2:NEXT:DC=DC+L:DD=DD+L:A=MS+(2*LL):MS=A
670 IFDD<=EMTHEN610
680 GOSUB7000:RETURN
690 REM@ \SLOWFOR
900 PRINT"[147][154]SIE VERSTECKEN SICH AUF EINEM PLANETEN IN EINEM LABYRINTH"
910 PRINT"FINDEN SIE DEN AUSGANG BEVOR IHNEN DER SAUERSTOFF AUSGEHT."
920 PRINT"[150]SIE BENUETZEN DEN JOYSTICK ODER:"
922 PRINT"L = LINKS R = RECHTS"
923 PRINT"O = DREHUNG UM 180 GRADG = GEHEN"
924 PRINT"[129]P = DRUCKER[154]"
925 PRINT"[129]K = KARTE[154]"
930 PRINT"[152]WOLLEN SIE DIE GROESSE EINGEBEN(J/N)?"
932 PRINT"[153][129]ANSONSTEN BERECHNUNGN DURCH ZUFALL"
934 GETA$:IFA$="N"THEN940
935 IFA$<>"J"THEN934
936 INPUT"[147][152]LAENGE:";LZ:IFLZ<1ORLZ>12THEN936
937 INPUT"BREITE:";BZ
938 IFBZ<1ORBZ>19THENPRINT"[145][145][145][145][145][145][145][145]":GOTO937
940 PRINT"[147][156]EINGABE DER SAUERSTOFFMENGE"
941 PRINT"FUER BERECHNUNG RETURN DRUECKEN"
942 GX=0:INPUT"SAUERSTOFF:";GX
943 IFGX>999THEN940
945 PRINT"[147]BITTE WARTEN[129]"
950 TL=1032:BL=1992:TR=TL+24:BR=BL+24:LL=40:DV=4:CD=5
955 W1=99:W2=100:W3=160:W4=88
960 W(0)=5:W(1)=7:W(2)=3:W(3)=2:L=INT(RND(1)*5+6):IFBZ>0THENL=BZ
970 M(0)=1:M(1)=L:M(2)=-1:M(3)=-L:M(4)=TL:M(5)=BL:M(6)=TR:M(7)=BR
975 W=INT(RND(1)*5+6):IFLZ>0THENW=LZ
980 H=L*W-1:G=L-1:C=0:DC=0:T=0:RM=0
995 SM=25000:EM=SM+H:FORA=SMTOEM:POKEA,210:NEXT:P=SM+INT(RND(1)*H)
1000 EC=SM+INT(RND(1)*L):MC=INT(RND(1)*H)+SM
1003 IFOX>0THEN1010
1005 OX=INT(H/3)+1
1010 IFP<OXTHENOX=-OX
1015 OX=OX+H:OL=1:TT=INT(RND(1)*H/8)+1:GOSUB500:GOSUB2000
1017 IFGX>0THENOX=GX+1
1030 M=0:NP=P:CE=PEEK(EC):CE=CE/W(3):POKEEC,CE:GOTO380
2000 PRINT"[147]":RETURN
3000 FORX=0TO1000:PRINT"[145]":NEXT:RETURN
4000 GETA$:IFA$=""THEN4000
4010 POKE53281,11:CO=8:PRINT"[147][154]KARTE(J/N)?"
4020 GETA$:IFA$="N"THEN4500
4030 IFA$<>"J"THEN4020
4040 PRINT"[147]";:GOSUB605
4060 PRINT"-TASTE-"
4065 FORI=1TO11:GETA$:NEXT
4070 GETA$:IFA$=""THEN4070
4500 PRINT"[147][129]NOCH EINMAL(J/N)?[154]"
4510 GETA$:IFA$="J"THENRETURN
4520 IFA$<>"N"THEN4510
4530 PRINT"[147]";:POKE53280,14:POKE53281,6:END
5000 OPEN4,4:PRINT#4,CHR$(14)
5005 FORI=1024TO2023STEP40:P$=""
5010 FORJ=0TO39:X=PEEK(J+I)
5020 IFX<32THENX=X+64:GOTO5100
5025 IFX<64THEN5100
5030 IFX<96THENX=X+32:GOTO5100
5035 IFX<128THENX=X+64:GOTO5100
5100 P$=P$+CHR$(X)
5150 NEXT:PRINT#4,P$:NEXT
5155 CLOSE4
5160 RETURN
6000 :
6001 PRINT"AUSGANG ERREICHT"
6010 GOSUB3000
6720 RETURN
6800 POKES+13,15*16+12:POKES+11,129
6805 POKES+24,15+16:POKES+23,15*16+1:POKES+6,15*16:POKES,200:POKES+1,3
6810 POKES+4,129:FORI=3000TO0STEP-5:POKE53280,7:POKES+7,IAND255:POKES+8,I/256
6815 POKE53280,6:NEXT:POKES+1,1:POKES,170
6820 GOSUB8000:GOSUB7000:RETURN
7000 FORI=0TO24:POKES+I,0:NEXT:POKES+6,15*16+11:POKES+24,15:POKES,162:POKES+1,14
7010 RETURN
7500 POKES+23,2+15*16:POKES+24,15+16:RETURN
8000 PRINT"[147]";
8002 A$="[129][159][156][158][129][149][150][151][152][153][154][155]":FORI=1TO35:PRINTMID$(A$,(IAND15)+1,1);:GOSUB8008
8003 NEXTI:RETURN
8008 PRINT"";
8009 PRINT" [164][164][164][164] ";
8010 PRINT" [206] [206][165] ";
8020 PRINT" [207][183][183][208] [165] ";
8030 PRINT" [175][175][175][165] [167] [204][175][175][175] ";
8040 PRINT" [206] [165] [167][206] [206][180] ";
8050 PRINT" [207][183][183][183] [183][183][183][208] [180] ";
8060 PRINT" [180] [170] [180] ";
8070 PRINT" [204][175][175][175] [175][175][175][186][206] ";
8080 PRINT" [180] [170] [180] ";
8090 PRINT" [180] [170] [180] ";
8100 PRINT" [180] [170] [180] ";
8110 PRINT" [180] [170] [180] ";
8120 PRINT" [180] [170] [180] ";
8130 PRINT" [180] [170] [180] ";
8140 PRINT" [204][175][175][186][206] ";
8150 PRINT" ";
8160 PRINT" ";
8170 PRINT"[158] RUHE IN FRIEDEN "
8180 RETURN
9000 PRINT"[147] DEMO ZUM BASIC-BOSS COMPILER
9001 [153]" 'LABYRINTH' WURDE AUSSCHLIESSLICH IN
9002 PRINT" BASIC GESCHRIEBEN !
9004 [153]" (THILO HERRMANN, 1988)
9006 PRINTCHR$(142)CHR$(8)
9007 GOTO9200
9008 PRINT"";
9009 PRINT"[161] ";
9010 PRINT"[161] [161] [161] [161] ";
9020 PRINT"[161] [161] [211] [161] [161] ";
9030 PRINT"[161] [162][162][162] [161] [184][207][184] [161] ";
9040 PRINT" [146] [161][207][184][184][205] [161] [161][182][206][190][161][182][184][205] [161] [207][184][205] ";
9050 PRINT" [146] [206][184][184][161][161] [182] [161] [161][182] [161][182] [161] [161] [161] [182] ";
9060 PRINT" [146] [161] [161][161] [206] [161] [161][182] [161][182] [161] [161] [161] [182] ";
9070 PRINT"[184][184][184][184] [184][184][184] [184][184][184] [184][184][184][161] ";
9080 PRINT" [161] ";
9090 PRINT" [162][206]"
9095 RETURN
9200 A$="[159][156][158][129][149][150][151][152][153][154][155][129]":I=0
9202 GETB$:IFB$<>""THENRETURN
9205 I=I+1:PRINTMID$(A$,(IAND15)+1,1);
9210 GOSUB9008:GOTO9202
9220 RETURN
15000 A$=""
15005 IF(PEEK(56320)AND1)=0THENA$="G"
15010 IF(PEEK(56320)AND2)=0THENA$="O"
15020 IF(PEEK(56320)AND4)=0THENA$="L"
15030 IF(PEEK(56320)AND8)=0THENA$="R"
15040 IF(PEEK(56320)AND16)=0THENA$="K"
15050 IF A$=""THENGETA$:GOTO15005
15090 RETURN