home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Commodore Disc 44
/
Commodore_Disc_44_19xx_-_de.d64
/
raeuber
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
8KB
|
325 lines
10 rem raeuber=============c64/128
20 rem (p) commodore disc
30 rem ===========================
40 rem (c) by eckhard schulz v3.5
50 rem (v) a. mittelmeyer v2.0/7.0
60 rem
70 rem
80 rem c64/c128
90 rem ===========================
95 rx=7:ry=8:lt=(peek(772)=124):ifltthenrx=781:ry=782
100 gosub2860
110 ifltthenpoke53280,0:poke53281,0:goto115
111 (NULL)1,chr$(133):(NULL)0,1:(NULL)4,1
115 printwh$
120 printchr$(142)chr$(8):gosub2740
130 h=12:v=7:h1=h+1:w=4864:v1=5300
135 ifltthenw=49152:v1=49500
140 i=rnd(-ti)
150 dimxl(4),n2(4),yl(4),xr(4)
160 fori=0to4:readxl(i),n2(i),yl(i),xr(i):next
170 data8,20,-4,31,8,12,1,27,12,6,5,24,15,2,8,22,17,0,10,21
180 cx=int(rnd(1)*h)+1:cy=int(rnd(1)*v)+1
190 c=cx:r=cy:s=0
200 fori=0to(v+1)*h1:pokew+i,0:pokev1+i,0:next
210 printcl$c4$c4$"aufbau des labyrinthes"
220 da=0:n=0:av=v1+c+r*h1:aw=w+c+r*h1:pokeaw,1:s=s+1:ifs>=h*vthen480
230 printmid$(rf$,(sand1)+1,1)"[214]";
240 ifc>1andpeek(aw-1)=0thenda=da+2:n=n+1
250 ifc<handpeek(aw+1)=0thenda=da+1:n=n+1
260 ifr>1andpeek(aw-h1)=0thenda=da+8:n=n+1
270 if(r<vandpeek(aw+h1)=0)thenda=da+4:n=n+1
280 n=int(rnd(1)*n)+1
290 onda+1goto300,470,460,330,450,340,350,360,440,370,380,390,400,410,420,430
300 s=s-1
310 c=c+1:ifc>hthenc=1:r=r+1:ifr>vthenr=1
320 onpeek(w+c+r*h1)+1goto310,220
330 onngoto460,470
340 onngoto450,470
350 onngoto450,460
360 onngoto450,460,470
370 onngoto440,470
380 onngoto440,460
390 onngoto440,460,470
400 onngoto440,450
410 onngoto440,450,470
420 onngoto440,450,460
430 onngoto440,450,460,470
440 r=r-1:av=av-h1:pokeav,peek(av)or1:goto220
450 pokeav,peek(av)or1:r=r+1:av=av+h1:goto220
460 c=c-1:av=av-1:pokeav,peek(av)or2:goto220
470 pokeav,peek(av)or2:c=c+1:av=av+1:goto220
480 i=rnd(1)>.5:j=rnd(1):k=rnd(1)>.5
490 ifithenx=int(j*h)+1:y=v+(v-1)*k
500 ifi=0theny=int(j*v)+1:x=h+(h-1)*k
510 if(cx-x)^2+(cy-y)^2<(h^2+v^2)/9then480
520 sx=x:sy=y
530 ti$="000000"
540 :
550 printcl$
560 fori=wtow+(v+1)*h1:pokei,0:next
570 d=int(rnd(1)*4)
580 t4=ti:poke(w+x+y*h1),1
590 iff=0thengosub950:printhe$;int(sqr((x-cx)^2+(y-cy)^2)*10+.5)/10
600 ifcx=xandcy=ythen2590
610 getq$:ifq$<>""then620
611 ifltthen614
612 jq=(NULL)(2):ifjq=0then610
613 goto630
614 jq=0:poke56322,244:jo=peek(56320):poke56322,255
615 ifjo>126orjo<119then610
616 jo=127-jo:jq=val(mid$("15070003",jo,1))
620 ifltthenpoke198,0
630 ifq$=chr$(133)thenk=ti:goto2620
640 ifq$=c4$orjq=5thend=d+2
650 ifq$=c1$orjq=7thend=d-1
660 ifq$=c3$orjq=3thend=d+1
670 ifd<0thend=d+4
680 ifd>3thend=d-4
690 ifq$<>c2$andjq<>1then590
700 av=v1+x+y*h1:aw=w+x+y*h1
710 ondgoto740,760,780
720 ify>1and(peek(av-h1)and1)theny=y-1:pokeaw-h1,1:goto590
730 goto790
740 ifx<hand(peek(av)and2)thenx=x+1:pokeaw+1,1:goto590
750 goto790
760 ify<vand(peek(av)and1)theny=y+1:pokeaw+h1,1:goto590
770 goto790
780 ifx>1and(peek(av-1)and2)thenx=x-1:pokeaw-1,1:goto590
790 dn=23:gosub2710
800 printtab(16)zz$ze$ze$ze$ze$left$(ql$,14)c4$rn$"kein durchgang"c2$:fori=1to1000:next
810 printtab(16)c2$spc(14)left$(ql$,14)c4$spc(14)c2$:goto600
820 printcl$" ";
830 fori=1toh:printze$ze$ze$;:next:printc4$c4$
840 forj=1tov:printz9$c2$c1$z9$c2$c1$z9$c4$c4$;:fori=1toh
850 k=peek(v1+i+j*h1)
860 printmid$(ze$+ze$+zp$+b2$+z9$+ze$+ze$+ze$+b3$,1+3*k,3);
870 ifk<2thenprintc2$c1$z9$c2$c1$z9$c4$c4$;
880 printc2$c1$;
890 ifpeek(w+i+j*h1)=1thenprintc1$+".";
900 ifi=sxandj=sythenprintc1$+rn$+" "+rf$;
910 ifi=cxandj=cythenprintc1$+z5$;
920 ifi=xandj=ythenprintc1$;mid$("^>v<",d+1,1);
930 printc3$c4$;
940 next:printc4$c4$:next:return
950 s=0:printcl$
960 av=v1+x+y*h1
970 ondgoto1120,1260,1400
980 ifsy=y-sandsx=xthengosub2520
990 ifcy=y-sandcx=xthengosub2440
1000 k=peek(av-(s+1)*h1):ifk=0ork=2goto1070
1010 ifpeek(av-s*h1)and2thengosub1550:goto1030
1020 gosub1670
1030 ifpeek(av-1-s*h1)and2thengosub2020:goto1050
1040 gosub2140
1050 s=s+1:ifs>4goto1540
1060 goto980
1070 ifpeek(av-s*h1)and2thengosub1750:goto1090
1080 gosub2220
1090 ifpeek(av-1-s*h1)and2thengosub1890:goto1110
1100 gosub2320
1110 return
1120 ifcy=yandcx=x+sthengosub2440
1130 ifsy=yandsx=x+sthengosub2520
1140 k=peek(av+s):ifk=0ork=1goto1210
1150 ifpeek(av+s)=2thengosub1670:goto1170
1160 gosub1550
1170 ifpeek(av+s-h1)and1thengosub2020:goto1190
1180 gosub2140
1190 s=s+1:ifs>4goto1540
1200 goto1120
1210 ifpeek(av+s)=0thengosub2220:goto1230
1220 gosub1750
1230 ifpeek(av+s-h1)and1thengosub1890:goto1250
1240 gosub2320
1250 return
1260 ifcy=y+sandcx=xthengosub2440
1270 ifsy=y+sandsx=xthengosub2520
1280 k=peek(av+s*h1):ifk=0ork=2thengoto1350
1290 ifpeek(av-1+s*h1)and2thengosub1550:goto1310
1300 gosub1670
1310 ifpeek(av+s*h1)=1thengosub2140:goto1330
1320 gosub2020
1330 s=s+1:ifs>4goto1540
1340 goto1260
1350 ifpeek(av-1+s*h1)and2thengosub1750:goto1370
1360 gosub2220
1370 ifpeek(av+s*h1)=0thengosub2320:goto1390
1380 gosub1890
1390 return
1400 ifcx=x-sandcy=ythengosub2440
1410 ifsx=x-sandsy=ythengosub2520
1420 k=peek(av-(s+1)):ifk=0ork=1thengoto1490
1430 ifpeek(av-s-h1)and1thengosub1550:goto1450
1440 gosub1670
1450 ifpeek(av-s)and1thengosub2020:goto1470
1460 gosub2140
1470 s=s+1:ifs>4then1540
1480 goto1400
1490 ifpeek(av-s-h1)and1thengosub1750:goto1510
1500 gosub2220
1510 ifpeek(av-s)and1thengosub1890:goto1530
1520 gosub2320
1530 return
1540 dn=11:gosub2710:printtab(19)"[205][206]"c4$c1$c1$"[206][205]"he$:return
1550 dn=yl(s):gosub2710
1560 ifs=0thenprinttab(xr(s))ze$
1570 ifs>0ands<4thenfori=1to4-s:printtab(xr(s)+5-s)zj$:next
1580 ifs>0thenprinttab(xr(s))mid$(ze$+ze$+ze$+ze$+zj$,s)
1590 ifs=4thenprinttab(xr(s))zj$+zj$+c4$+c1$+c1$+zj$+zj$
1600 q$="":ifs>0thenq$=mid$(c3$+c3$+c3$+zj$,s)
1610 ifs<4thenfori=0ton2(s)+1:printtab(xr(s))zj$q$:next
1620 ifs>0thenprinttab(xr(s))mid$(zm$+zm$+zm$+zm$+zj$,s)
1630 ifs>0ands<4thenfori=1to4-s:printtab(xr(s)+5-s)zj$:next
1640 ifs=0thenprinttab(xr(s))zm$
1650 printhe$
1660 return
1670 dn=yl(s):gosub2710
1680 ifs=0thenprinttab(xr(s))"[206]":goto1700
1690 fori=1to5-s:printtab(xr(s)+5-s-i)"[206]":next
1700 dn=n2(s)+2:gosub2720
1710 ifs=0thenprinttab(xr(s))"[205]":goto1730
1720 fori=0to4-s:printtab(xr(s)+i)"[205]":next
1730 printhe$
1740 return
1750 j=3-s:ifs=0thenj=0
1760 printhe$;
1770 ifs>0goto1810
1780 printtab(20);:printc4$;:fori=1to18:printzm$;:next:printzm$
1790 dn=n2(0):gosub2720
1800 printtab(20);:fori=1to19:printze$;:next:goto1870
1810 dn=yl(s):gosub2720
1820 fori=1to5-s:printtab(j+xr(s)+2)zj$:next
1830 printtab(20);:fori=19toj++xr(s):printzm$;:next:printzj$
1840 ifs<4thenfori=1ton2(s):printtab(j+xr(s)+2)zj$:next
1850 printtab(20);:fori=19toj+xr(s):printze$;:next:printzj$
1860 fori=1to5-s:printtab(j+xr(s)+2)zj$:next
1870 printhe$
1880 return
1890 printhe$;
1900 ifs>0goto1940
1910 printc4$;:fori=1to11+xl(0):printzm$;:next:printzm$
1920 dn=n2(0):gosub2720
1930 fori=1to12+xl(0):printze$;:next:goto1870
1940 dn=yl(s):gosub2720
1950 fori=1to5-s:printtab(xl(s))z9$:next
1960 printtab(xl(s));:printz9$;:fori=xl(s)to17:printzm$;:next:printzm$
1970 ifs<4thenfori=1ton2(s):printtab(xl(s))z9$:next
1980 printtab(xl(s));:printz9$;:fori=xl(s)to17:printze$;:next:printze$
1990 fori=1to5-s:printtab(xl(s))z9$:next
2000 printhe$
2010 return
2020 dn=yl(s):gosub2710
2030 ifs=0thenprinttab(xl(s))ze$
2040 ifs>0ands<4thenfori=1to4-s:printtab(xl(s))z9$:next
2050 ifs>0thenprinttab(xl(s))left$(z9$+ze$+ze$+ze$+ze$,6-s)
2060 ifs=4thenprinttab(xl(s))z9$+z9$+c1$+c1$+c4$+z9$+z9$
2070 q$="":ifs>0thenq$=mid$(c3$+c3$+c3$+z9$,s)
2080 ifs<4thenfori=0ton2(s)+1:printtab(xl(s))z9$q$:next
2090 ifs>0thenprinttab(xl(s))left$(z9$+zm$+zm$+zm$+zm$,6-s)
2100 ifs>0ands<4thenfori=1to4-s:printtab(xl(s))z9$:next
2110 ifs=0thenprinttab(xl(s))zm$
2120 printhe$
2130 return
2140 dn=yl(s):gosub2710
2150 ifs=0thenprinttab(xl(s))"[205]":goto2170
2160 fori=1to5-s:printtab(xl(s)+i)"[205]":next
2170 dn=n2(s)+2:gosub2720
2180 ifs=0thenprinttab(xl(s))"[206]":goto2200
2190 fori=0to4-s:printtab(xl(s)+5-s-i)"[206]":next
2200 printhe$
2210 return
2220 gosub1670
2230 dn=yl(s)+5-s:gosub2710
2240 printtab(20);
2250 ifs<4thenfori=1toxr(s)-21:printzm$;:next
2260 print"[208]"c1$c4$;
2270 ifs<4thenfori=1ton2(s):printz9$c4$c1$;:next
2280 printzp$c1$c1$;
2290 ifs<4thenfori=1toxr(s)-20-1:printze$c1$c1$;:next
2300 printhe$
2310 return
2320 ifs=0thenj=5:goto2340
2330 j=0
2340 gosub2140
2350 dn=yl(s)+5-s:gosub2710
2360 printtab(19);
2370 ifs<4thenfori=1to18-xl(s)-5+s+j:printzm$c1$c1$;:next
2380 print"[207]"c1$c4$;
2390 ifs<4thenfori=1ton2(s):printzj$c4$c1$;:next
2400 print"[204]";
2410 ifs<4thenfori=1to18-xl(s)-5+s+j:printze$;:next
2420 printhe$
2430 return
2440 ifs=0ors=4thenreturn
2450 dn=18:gosub2710
2460 ifs=3thenprinttab(20)c2$+c2$+c2$+"."
2470 ifs=2thenprinttab(19)rn$+c2$+z8$+rf$+z8$+c1$+c1$+c4$+z5$+"[206]"+c2$+zj$
2480 ifs<>1thenreturn
2490 printtab(18)c4$" "ze$ze$ze$left$(ql$,4)c4$"[206]"b2$"[206]";
2500 printzj$left$(ql$,5)c4$z5$z5$z5$" "zj$left$(ql$,5)c4$z5$z5$z5$"[206]"
2510 return
2520 ifs=0ors=4thenreturn
2530 dn=20:gosub2710
2540 ifs=3thenprinttab(19)left$(qu$,5)+rn$+z1$+z1$+c2$+c1$+c1$+rf$+z1$+z1$
2550 ifs=2thenprinttab(16)c2$+c2$+c2$+rn$+z8$b3$b3$yq$
2560 ifs=1thenprinttab(13)rn$+z8$b$b2$yq$
2570 ifs=1thenprinttab(12)rn$+z8$b$b4$yq$
2580 return
2590 printhe$b$"deine zeit: "left$(ti$,2)":"mid$(ti$,3,2)"'"right$(ti$,2)b5$b4$
2600 k=ti:fori=1to25:pokerx,23:pokery,15:sys65520:print"gefunden":forj=1to50:nextj
2610 pokerx,23:pokery,15:sys65520:printb$:forj=1to50:nextj,i
2620 gosub820
2630 printtab(10)c2$"noch ein spiel";
2640 sw=1:tm=0
2650 gett$:ift$<>""then2680
2660 ifti>tmthenprintmid$("? ",sw,1)c1$;:tm=ti+15:sw=3-sw
2670 goto2650
2680 ift$="j"thenprint" ja.":goto180
2690 ift$="n"thenprint" nein"+c4$:end
2700 goto2650
2710 printhe$;
2720 ifdn>0thenforz=1todn:printc4$;:next
2730 return
2740 printcl$c4$spc(13)"schatzraeuber"
2750 printc4$spc(7)"(c) 1987 by eckhard schulz"
2760 printc4$c4$c4$" finde den schatz der in dem labyrinth
2770 [153]c4$" verborgen ist.
2780 printc4$" cursor up"b4$"= 1 schritt vorwaerts"
2790 print" cursor left"b2$"= drehung nach links"
2800 print" cursor right = drehung nach rechts
2810 [153]" cursor down"b2$"= drehung um 180 grad"
2820 [153]" f1"[166]11)"= hilfe"
2830 [153]c4$" analog dazu steuerung mit dem joystick"b2$c4$"in port ii."
2840 [153]c4$c4$[166]7)"druecke 'taste' zum start"
2850 [161]a$:[139]a$[178]""[167]2850
2851 [142]
2860 b$[178][199](32):b2$[178]b$[170]b$
2870 b3$[178]b2$[170]b$:b4$[178]b3$[170]b$
2880 b5$[178]b4$[170]b$:b$[178]b5$[170]b5$
2890 [143] nachspann ===============
2900 [143] * farbcodes/steuercodes *
2910 wh$[178][199](005):c4$[178][199](017)
2920 rn$[178][199](018):he$[178][199](019)
2930 c3$[178][199](029):c2$[178][199](145)
2940 rf$[178][199](146):cl$[178][199](147)
2950 c1$[178][199](157)
2960 [143] *** zeichensatz/graphik *
2970 z1$[178][199](162):z5$[178][199](166)
2980 z8$[178][199](169):z9$[178][199](170)
2990 ze$[178][199](175):zj$[178][199](180)
3000 zm$[178][199](183):zp$[178][199](186)
3010 yq$[178][199](223)
3020 [143] ********* zeichenfolgen *
3030 [129]q[178]1[164]10:zz$[178]zz$[170]ze$:[130]
3040 [129] q[178]1 [164] 40
3050 qu$[178]qu$[170]c2$:ql$[178]ql$[170]c1$
3060 [130] q
3070 [142]
3080 [143] =========================
3100 [143] 07955 bytes program
3110 [143] 00399 bytes variables
3120 [143] 00128 bytes arrays
3130 [143] 00505 bytes strings
3150 [143] =========================