home *** CD-ROM | disk | FTP | other *** search
/ 64'er / 64ER_CD.iso / 89xx / 8902c.d64 / labyrinth (.txt) < prev    next >
Commodore BASIC  |  1995-03-30  |  7KB  |  216 lines

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