home *** CD-ROM | disk | FTP | other *** search
/ 64'er 1989 February / 64er_Magazin_89-02_1989_Markt__Technik_de_Disk_2_of_2_Side_A.d64 / labyrinth (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  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.