home *** CD-ROM | disk | FTP | other *** search
/ Commodore Disc 44 / Commodore_Disc_44_19xx_-_de.d64 / raeuber (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  8KB  |  325 lines

  1. 10 rem raeuber=============c64/128
  2. 20 rem (p) commodore disc
  3. 30 rem ===========================
  4. 40 rem (c) by eckhard schulz  v3.5
  5. 50 rem (v) a. mittelmeyer v2.0/7.0
  6. 60 rem
  7. 70 rem
  8. 80 rem c64/c128
  9. 90 rem ===========================
  10. 95 rx=7:ry=8:lt=(peek(772)=124):ifltthenrx=781:ry=782
  11. 100 gosub2860
  12. 110 ifltthenpoke53280,0:poke53281,0:goto115
  13. 111 (NULL)1,chr$(133):(NULL)0,1:(NULL)4,1
  14. 115 printwh$
  15. 120 printchr$(142)chr$(8):gosub2740
  16. 130 h=12:v=7:h1=h+1:w=4864:v1=5300
  17. 135 ifltthenw=49152:v1=49500
  18. 140 i=rnd(-ti)
  19. 150 dimxl(4),n2(4),yl(4),xr(4)
  20. 160 fori=0to4:readxl(i),n2(i),yl(i),xr(i):next
  21. 170 data8,20,-4,31,8,12,1,27,12,6,5,24,15,2,8,22,17,0,10,21
  22. 180 cx=int(rnd(1)*h)+1:cy=int(rnd(1)*v)+1
  23. 190 c=cx:r=cy:s=0
  24. 200 fori=0to(v+1)*h1:pokew+i,0:pokev1+i,0:next
  25. 210 printcl$c4$c4$"aufbau des labyrinthes"
  26. 220 da=0:n=0:av=v1+c+r*h1:aw=w+c+r*h1:pokeaw,1:s=s+1:ifs>=h*vthen480
  27. 230 printmid$(rf$,(sand1)+1,1)"[214]";
  28. 240 ifc>1andpeek(aw-1)=0thenda=da+2:n=n+1
  29. 250 ifc<handpeek(aw+1)=0thenda=da+1:n=n+1
  30. 260 ifr>1andpeek(aw-h1)=0thenda=da+8:n=n+1
  31. 270 if(r<vandpeek(aw+h1)=0)thenda=da+4:n=n+1
  32. 280 n=int(rnd(1)*n)+1
  33. 290 onda+1goto300,470,460,330,450,340,350,360,440,370,380,390,400,410,420,430
  34. 300 s=s-1
  35. 310 c=c+1:ifc>hthenc=1:r=r+1:ifr>vthenr=1
  36. 320 onpeek(w+c+r*h1)+1goto310,220
  37. 330 onngoto460,470
  38. 340 onngoto450,470
  39. 350 onngoto450,460
  40. 360 onngoto450,460,470
  41. 370 onngoto440,470
  42. 380 onngoto440,460
  43. 390 onngoto440,460,470
  44. 400 onngoto440,450
  45. 410 onngoto440,450,470
  46. 420 onngoto440,450,460
  47. 430 onngoto440,450,460,470
  48. 440 r=r-1:av=av-h1:pokeav,peek(av)or1:goto220
  49. 450 pokeav,peek(av)or1:r=r+1:av=av+h1:goto220
  50. 460 c=c-1:av=av-1:pokeav,peek(av)or2:goto220
  51. 470 pokeav,peek(av)or2:c=c+1:av=av+1:goto220
  52. 480 i=rnd(1)>.5:j=rnd(1):k=rnd(1)>.5
  53. 490 ifithenx=int(j*h)+1:y=v+(v-1)*k
  54. 500 ifi=0theny=int(j*v)+1:x=h+(h-1)*k
  55. 510 if(cx-x)^2+(cy-y)^2<(h^2+v^2)/9then480
  56. 520 sx=x:sy=y
  57. 530 ti$="000000"
  58. 540 :
  59. 550 printcl$
  60. 560 fori=wtow+(v+1)*h1:pokei,0:next
  61. 570 d=int(rnd(1)*4)
  62. 580 t4=ti:poke(w+x+y*h1),1
  63. 590 iff=0thengosub950:printhe$;int(sqr((x-cx)^2+(y-cy)^2)*10+.5)/10
  64. 600 ifcx=xandcy=ythen2590
  65. 610 getq$:ifq$<>""then620
  66. 611 ifltthen614
  67. 612 jq=(NULL)(2):ifjq=0then610
  68. 613 goto630
  69. 614 jq=0:poke56322,244:jo=peek(56320):poke56322,255
  70. 615 ifjo>126orjo<119then610
  71. 616 jo=127-jo:jq=val(mid$("15070003",jo,1))
  72. 620 ifltthenpoke198,0
  73. 630 ifq$=chr$(133)thenk=ti:goto2620
  74. 640 ifq$=c4$orjq=5thend=d+2
  75. 650 ifq$=c1$orjq=7thend=d-1
  76. 660 ifq$=c3$orjq=3thend=d+1
  77. 670 ifd<0thend=d+4
  78. 680 ifd>3thend=d-4
  79. 690 ifq$<>c2$andjq<>1then590
  80. 700 av=v1+x+y*h1:aw=w+x+y*h1
  81. 710 ondgoto740,760,780
  82. 720 ify>1and(peek(av-h1)and1)theny=y-1:pokeaw-h1,1:goto590
  83. 730 goto790
  84. 740 ifx<hand(peek(av)and2)thenx=x+1:pokeaw+1,1:goto590
  85. 750 goto790
  86. 760 ify<vand(peek(av)and1)theny=y+1:pokeaw+h1,1:goto590
  87. 770 goto790
  88. 780 ifx>1and(peek(av-1)and2)thenx=x-1:pokeaw-1,1:goto590
  89. 790 dn=23:gosub2710
  90. 800 printtab(16)zz$ze$ze$ze$ze$left$(ql$,14)c4$rn$"kein durchgang"c2$:fori=1to1000:next
  91. 810 printtab(16)c2$spc(14)left$(ql$,14)c4$spc(14)c2$:goto600
  92. 820 printcl$" ";
  93. 830 fori=1toh:printze$ze$ze$;:next:printc4$c4$
  94. 840 forj=1tov:printz9$c2$c1$z9$c2$c1$z9$c4$c4$;:fori=1toh
  95. 850 k=peek(v1+i+j*h1)
  96. 860 printmid$(ze$+ze$+zp$+b2$+z9$+ze$+ze$+ze$+b3$,1+3*k,3);
  97. 870 ifk<2thenprintc2$c1$z9$c2$c1$z9$c4$c4$;
  98. 880 printc2$c1$;
  99. 890 ifpeek(w+i+j*h1)=1thenprintc1$+".";
  100. 900 ifi=sxandj=sythenprintc1$+rn$+" "+rf$;
  101. 910 ifi=cxandj=cythenprintc1$+z5$;
  102. 920 ifi=xandj=ythenprintc1$;mid$("^>v<",d+1,1);
  103. 930 printc3$c4$;
  104. 940 next:printc4$c4$:next:return
  105. 950 s=0:printcl$
  106. 960 av=v1+x+y*h1
  107. 970 ondgoto1120,1260,1400
  108. 980 ifsy=y-sandsx=xthengosub2520
  109. 990 ifcy=y-sandcx=xthengosub2440
  110. 1000 k=peek(av-(s+1)*h1):ifk=0ork=2goto1070
  111. 1010 ifpeek(av-s*h1)and2thengosub1550:goto1030
  112. 1020 gosub1670
  113. 1030 ifpeek(av-1-s*h1)and2thengosub2020:goto1050
  114. 1040 gosub2140
  115. 1050 s=s+1:ifs>4goto1540
  116. 1060 goto980
  117. 1070 ifpeek(av-s*h1)and2thengosub1750:goto1090
  118. 1080 gosub2220
  119. 1090 ifpeek(av-1-s*h1)and2thengosub1890:goto1110
  120. 1100 gosub2320
  121. 1110 return
  122. 1120 ifcy=yandcx=x+sthengosub2440
  123. 1130 ifsy=yandsx=x+sthengosub2520
  124. 1140 k=peek(av+s):ifk=0ork=1goto1210
  125. 1150 ifpeek(av+s)=2thengosub1670:goto1170
  126. 1160 gosub1550
  127. 1170 ifpeek(av+s-h1)and1thengosub2020:goto1190
  128. 1180 gosub2140
  129. 1190 s=s+1:ifs>4goto1540
  130. 1200 goto1120
  131. 1210 ifpeek(av+s)=0thengosub2220:goto1230
  132. 1220 gosub1750
  133. 1230 ifpeek(av+s-h1)and1thengosub1890:goto1250
  134. 1240 gosub2320
  135. 1250 return
  136. 1260 ifcy=y+sandcx=xthengosub2440
  137. 1270 ifsy=y+sandsx=xthengosub2520
  138. 1280 k=peek(av+s*h1):ifk=0ork=2thengoto1350
  139. 1290 ifpeek(av-1+s*h1)and2thengosub1550:goto1310
  140. 1300 gosub1670
  141. 1310 ifpeek(av+s*h1)=1thengosub2140:goto1330
  142. 1320 gosub2020
  143. 1330 s=s+1:ifs>4goto1540
  144. 1340 goto1260
  145. 1350 ifpeek(av-1+s*h1)and2thengosub1750:goto1370
  146. 1360 gosub2220
  147. 1370 ifpeek(av+s*h1)=0thengosub2320:goto1390
  148. 1380 gosub1890
  149. 1390 return
  150. 1400 ifcx=x-sandcy=ythengosub2440
  151. 1410 ifsx=x-sandsy=ythengosub2520
  152. 1420 k=peek(av-(s+1)):ifk=0ork=1thengoto1490
  153. 1430 ifpeek(av-s-h1)and1thengosub1550:goto1450
  154. 1440 gosub1670
  155. 1450 ifpeek(av-s)and1thengosub2020:goto1470
  156. 1460 gosub2140
  157. 1470 s=s+1:ifs>4then1540
  158. 1480 goto1400
  159. 1490 ifpeek(av-s-h1)and1thengosub1750:goto1510
  160. 1500 gosub2220
  161. 1510 ifpeek(av-s)and1thengosub1890:goto1530
  162. 1520 gosub2320
  163. 1530 return
  164. 1540 dn=11:gosub2710:printtab(19)"[205][206]"c4$c1$c1$"[206][205]"he$:return
  165. 1550 dn=yl(s):gosub2710
  166. 1560 ifs=0thenprinttab(xr(s))ze$
  167. 1570 ifs>0ands<4thenfori=1to4-s:printtab(xr(s)+5-s)zj$:next
  168. 1580 ifs>0thenprinttab(xr(s))mid$(ze$+ze$+ze$+ze$+zj$,s)
  169. 1590 ifs=4thenprinttab(xr(s))zj$+zj$+c4$+c1$+c1$+zj$+zj$
  170. 1600 q$="":ifs>0thenq$=mid$(c3$+c3$+c3$+zj$,s)
  171. 1610 ifs<4thenfori=0ton2(s)+1:printtab(xr(s))zj$q$:next
  172. 1620 ifs>0thenprinttab(xr(s))mid$(zm$+zm$+zm$+zm$+zj$,s)
  173. 1630 ifs>0ands<4thenfori=1to4-s:printtab(xr(s)+5-s)zj$:next
  174. 1640 ifs=0thenprinttab(xr(s))zm$
  175. 1650 printhe$
  176. 1660 return
  177. 1670 dn=yl(s):gosub2710
  178. 1680 ifs=0thenprinttab(xr(s))"[206]":goto1700
  179. 1690 fori=1to5-s:printtab(xr(s)+5-s-i)"[206]":next
  180. 1700 dn=n2(s)+2:gosub2720
  181. 1710 ifs=0thenprinttab(xr(s))"[205]":goto1730
  182. 1720 fori=0to4-s:printtab(xr(s)+i)"[205]":next
  183. 1730 printhe$
  184. 1740 return
  185. 1750 j=3-s:ifs=0thenj=0
  186. 1760 printhe$;
  187. 1770 ifs>0goto1810
  188. 1780 printtab(20);:printc4$;:fori=1to18:printzm$;:next:printzm$
  189. 1790 dn=n2(0):gosub2720
  190. 1800 printtab(20);:fori=1to19:printze$;:next:goto1870
  191. 1810 dn=yl(s):gosub2720
  192. 1820 fori=1to5-s:printtab(j+xr(s)+2)zj$:next
  193. 1830 printtab(20);:fori=19toj++xr(s):printzm$;:next:printzj$
  194. 1840 ifs<4thenfori=1ton2(s):printtab(j+xr(s)+2)zj$:next
  195. 1850 printtab(20);:fori=19toj+xr(s):printze$;:next:printzj$
  196. 1860 fori=1to5-s:printtab(j+xr(s)+2)zj$:next
  197. 1870 printhe$
  198. 1880 return
  199. 1890 printhe$;
  200. 1900 ifs>0goto1940
  201. 1910 printc4$;:fori=1to11+xl(0):printzm$;:next:printzm$
  202. 1920 dn=n2(0):gosub2720
  203. 1930 fori=1to12+xl(0):printze$;:next:goto1870
  204. 1940 dn=yl(s):gosub2720
  205. 1950 fori=1to5-s:printtab(xl(s))z9$:next
  206. 1960 printtab(xl(s));:printz9$;:fori=xl(s)to17:printzm$;:next:printzm$
  207. 1970 ifs<4thenfori=1ton2(s):printtab(xl(s))z9$:next
  208. 1980 printtab(xl(s));:printz9$;:fori=xl(s)to17:printze$;:next:printze$
  209. 1990 fori=1to5-s:printtab(xl(s))z9$:next
  210. 2000 printhe$
  211. 2010 return
  212. 2020 dn=yl(s):gosub2710
  213. 2030 ifs=0thenprinttab(xl(s))ze$
  214. 2040 ifs>0ands<4thenfori=1to4-s:printtab(xl(s))z9$:next
  215. 2050 ifs>0thenprinttab(xl(s))left$(z9$+ze$+ze$+ze$+ze$,6-s)
  216. 2060 ifs=4thenprinttab(xl(s))z9$+z9$+c1$+c1$+c4$+z9$+z9$
  217. 2070 q$="":ifs>0thenq$=mid$(c3$+c3$+c3$+z9$,s)
  218. 2080 ifs<4thenfori=0ton2(s)+1:printtab(xl(s))z9$q$:next
  219. 2090 ifs>0thenprinttab(xl(s))left$(z9$+zm$+zm$+zm$+zm$,6-s)
  220. 2100 ifs>0ands<4thenfori=1to4-s:printtab(xl(s))z9$:next
  221. 2110 ifs=0thenprinttab(xl(s))zm$
  222. 2120 printhe$
  223. 2130 return
  224. 2140 dn=yl(s):gosub2710
  225. 2150 ifs=0thenprinttab(xl(s))"[205]":goto2170
  226. 2160 fori=1to5-s:printtab(xl(s)+i)"[205]":next
  227. 2170 dn=n2(s)+2:gosub2720
  228. 2180 ifs=0thenprinttab(xl(s))"[206]":goto2200
  229. 2190 fori=0to4-s:printtab(xl(s)+5-s-i)"[206]":next
  230. 2200 printhe$
  231. 2210 return
  232. 2220 gosub1670
  233. 2230 dn=yl(s)+5-s:gosub2710
  234. 2240 printtab(20);
  235. 2250 ifs<4thenfori=1toxr(s)-21:printzm$;:next
  236. 2260 print"[208]"c1$c4$;
  237. 2270 ifs<4thenfori=1ton2(s):printz9$c4$c1$;:next
  238. 2280 printzp$c1$c1$;
  239. 2290 ifs<4thenfori=1toxr(s)-20-1:printze$c1$c1$;:next
  240. 2300 printhe$
  241. 2310 return
  242. 2320 ifs=0thenj=5:goto2340
  243. 2330 j=0
  244. 2340 gosub2140
  245. 2350 dn=yl(s)+5-s:gosub2710
  246. 2360 printtab(19);
  247. 2370 ifs<4thenfori=1to18-xl(s)-5+s+j:printzm$c1$c1$;:next
  248. 2380 print"[207]"c1$c4$;
  249. 2390 ifs<4thenfori=1ton2(s):printzj$c4$c1$;:next
  250. 2400 print"[204]";
  251. 2410 ifs<4thenfori=1to18-xl(s)-5+s+j:printze$;:next
  252. 2420 printhe$
  253. 2430 return
  254. 2440 ifs=0ors=4thenreturn
  255. 2450 dn=18:gosub2710
  256. 2460 ifs=3thenprinttab(20)c2$+c2$+c2$+"."
  257. 2470 ifs=2thenprinttab(19)rn$+c2$+z8$+rf$+z8$+c1$+c1$+c4$+z5$+"[206]"+c2$+zj$
  258. 2480 ifs<>1thenreturn
  259. 2490 printtab(18)c4$" "ze$ze$ze$left$(ql$,4)c4$"[206]"b2$"[206]";
  260. 2500 printzj$left$(ql$,5)c4$z5$z5$z5$" "zj$left$(ql$,5)c4$z5$z5$z5$"[206]"
  261. 2510 return
  262. 2520 ifs=0ors=4thenreturn
  263. 2530 dn=20:gosub2710
  264. 2540 ifs=3thenprinttab(19)left$(qu$,5)+rn$+z1$+z1$+c2$+c1$+c1$+rf$+z1$+z1$
  265. 2550 ifs=2thenprinttab(16)c2$+c2$+c2$+rn$+z8$b3$b3$yq$
  266. 2560 ifs=1thenprinttab(13)rn$+z8$b$b2$yq$
  267. 2570 ifs=1thenprinttab(12)rn$+z8$b$b4$yq$
  268. 2580 return
  269. 2590 printhe$b$"deine zeit: "left$(ti$,2)":"mid$(ti$,3,2)"'"right$(ti$,2)b5$b4$
  270. 2600 k=ti:fori=1to25:pokerx,23:pokery,15:sys65520:print"gefunden":forj=1to50:nextj
  271. 2610 pokerx,23:pokery,15:sys65520:printb$:forj=1to50:nextj,i
  272. 2620 gosub820
  273. 2630 printtab(10)c2$"noch ein spiel";
  274. 2640 sw=1:tm=0
  275. 2650 gett$:ift$<>""then2680
  276. 2660 ifti>tmthenprintmid$("? ",sw,1)c1$;:tm=ti+15:sw=3-sw
  277. 2670 goto2650
  278. 2680 ift$="j"thenprint" ja.":goto180
  279. 2690 ift$="n"thenprint" nein"+c4$:end
  280. 2700 goto2650
  281. 2710 printhe$;
  282. 2720 ifdn>0thenforz=1todn:printc4$;:next
  283. 2730 return
  284. 2740 printcl$c4$spc(13)"schatzraeuber"
  285. 2750 printc4$spc(7)"(c) 1987 by eckhard schulz"
  286. 2760 printc4$c4$c4$" finde den schatz der in dem labyrinth
  287. 2770 [153]c4$" verborgen ist.
  288. 2780 printc4$" cursor up"b4$"= 1 schritt vorwaerts"
  289. 2790 print" cursor left"b2$"= drehung nach links"
  290. 2800 print" cursor right = drehung nach rechts
  291. 2810 [153]" cursor down"b2$"= drehung um 180 grad"
  292. 2820 [153]" f1"[166]11)"= hilfe"
  293. 2830 [153]c4$" analog dazu steuerung mit dem joystick"b2$c4$"in port ii."
  294. 2840 [153]c4$c4$[166]7)"druecke 'taste' zum start"
  295. 2850 [161]a$:[139]a$[178]""[167]2850
  296. 2851 [142]
  297. 2860 b$[178][199](32):b2$[178]b$[170]b$
  298. 2870 b3$[178]b2$[170]b$:b4$[178]b3$[170]b$
  299. 2880 b5$[178]b4$[170]b$:b$[178]b5$[170]b5$
  300. 2890 [143] nachspann ===============
  301. 2900 [143] * farbcodes/steuercodes *
  302. 2910 wh$[178][199](005):c4$[178][199](017)
  303. 2920 rn$[178][199](018):he$[178][199](019)
  304. 2930 c3$[178][199](029):c2$[178][199](145)
  305. 2940 rf$[178][199](146):cl$[178][199](147)
  306. 2950 c1$[178][199](157)
  307. 2960 [143] *** zeichensatz/graphik *
  308. 2970 z1$[178][199](162):z5$[178][199](166)
  309. 2980 z8$[178][199](169):z9$[178][199](170)
  310. 2990 ze$[178][199](175):zj$[178][199](180)
  311. 3000 zm$[178][199](183):zp$[178][199](186)
  312. 3010 yq$[178][199](223)
  313. 3020 [143] ********* zeichenfolgen *
  314. 3030 [129]q[178]1[164]10:zz$[178]zz$[170]ze$:[130]
  315. 3040 [129] q[178]1 [164] 40
  316. 3050 qu$[178]qu$[170]c2$:ql$[178]ql$[170]c1$
  317. 3060 [130] q
  318. 3070 [142]
  319. 3080 [143] =========================
  320. 3100 [143] 07955 bytes program
  321. 3110 [143] 00399 bytes variables
  322. 3120 [143] 00128 bytes arrays
  323. 3130 [143] 00505 bytes strings
  324. 3150 [143] =========================
  325.