home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 3
/
003.d81
/
smurk
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
22KB
|
732 lines
1 ifpeek(52016)<>32orpeek(52040)<>245thenload"linput.pr",8,1
2 rem smurk
3 rem by daniel tobias
4 rem c64 version 1.1
5 rem 6/15/84
7 na$="smurk"
8 poke 53280,5:poke53281,1:print"[144]"
10 print"":li=52016
15 dim lv%(100,8),ld$(100,1),id$(50),il%(50),sc%(50),iw(50),l%(100)
17 dim wd$(100),w%(100,1),fw%(2)
18 dimfb%(50),re%(50)
20 gosub 18000:gosub 19000
60 print"[147]"
100 rem start
108 xx=1
110 ifsc%>=1000thenprint"[217]ou win!":goto1500
115 ifxx=1thengosub1000
120 gosub500
125 xx=xx+1:ifxx>5thenxx=1
130 iffw%(0)=0thenprint"[215]hat?":goto110
140 onfw%(0)gosub2000,3000,4000,5000,5500,6000,7000,8000,9000,9500
142 iffw%(0)>10thenonfw%(0)-10gosub13000,13500,14500,15000,15500,16000,16500
143 iffw%(0)=18thengosub10000
144 iffw%(0)=19thengosub17000
145 iffw%(0)=99then1500
150 t=t+1
160 goto110
200 rem convert to lower case
220 for ip=1tolen(i$)
230 ch$=mid$(i$,ip,1)
240 ifch$>="[193]"andch$<="[218]"theni$=left$(i$,ip-1)+chr$(asc(ch$)-128)+mid$(i$,ip+1)
245 ifch$=chr$(160)theni$=left$(i$,ip-1)+" "+mid$(i$,ip+1)
250 ifch$<"a"theni$=left$(i$,ip-1)+" "+mid$(i$,ip+1)
260 next ip
270 return
330 goto63000
500 rem handle input
505 fw%(0)=0:fw%(1)=0
506 fw%(2)=0
510 print"-->";:sysli,b$:i$=b$+"":print
515 if i$="" then 510
518 gosub 200
520 wd$="":a=1
530 if mid$(i$,a,1)=" " then 600
540 wd$=wd$+mid$(i$,a,1)
550 a=a+1:ifa<=len(i$)then530
600 rem found word
610 forb=1tonw:ifwd$(b)=wd$thengosub643
620 nextb:wd$="":a=a+1
630 ifa>len(i$)thenreturn
640 goto530
643 ifw%(b,1)>100andfw%(1)<>0thenreturn
646 ifw%(b,1)>100andfw%(0)=0thenfw%(0)=1
650 forc=0to1
655 ifc=1andfw%(c)>0and(w%(b,c)=2orw%(b,c)=23orw%(b,c)=21)then700
660 ifw%(b,c)>=0thenfw%(c)=w%(b,c)
670 nextc
680 return
700 fw%(2)=w%(b,c):goto670
1000 rem print description
1005 print
1006 ifl=11orl=38then1010
1007 ifl>5andlo%=0thenprint"[144][201]t is too dark to see.":return
1008 ifl>5theni=1:gosub11000:ifr=0thenprint"[144][201]t is too dark to see.":return
1010 printld$(l,l%(l))
1014 print
1015 l%(l)=1
1020 print"[207]pen pathways: ";:fora=1to8:iflv%(l,a)<>0thenprintdn$(a)" ";
1025 nexta
1030 print
1040 print"[214]isible objects:"
1045 x=0
1050 fora=1toni
1055 ifa=2andil%(a)=lthengosub5600:goto1070
1057 ifa=23andil%(a)=lthengosub5700:goto1070
1060 if il%(a)=lthenprint" "id$(a):x=1
1070 nexta
1080 ifx=0thenprint"[212]here are none."
1100 ifl=11andt%=0thenprint"[212]here is a ferocious tiger here!"
1110 ifl=11andt%<>0thenprint"[193] contented-looking tiger dozes here."
1120 ifl=38andsm%=0thenprint"[212]he [211]murk is here!"
1130 ifl=38andsm%<>0thenprint"[212]he dead body of the [211]murk lies here."
1480 print
1490 return
1500 rem end
1505 print"[144]"
1510 print:print"[211]top after"t"turns.":print"[198]inal score:"sc%"out of 1000.":print
1520 forls=1to2000:nextls:goto63000
2000 rem move
2005 iffw%(1)<101orfw%(1)>108thenprint"[199]o where?":return
2010 x=lv%(l,fw%(1)-100)
2020 ifx<0orx>nlthenprint"[206]ot defined yet.":return
2030 ifx=0thenprint"[217]ou can't go that way.":return
2040 ifl=3andx=3thenifrnd(0)<.37thenx=2
2045 a=0
2050 ifx=38theni=7:gosub11000:ifr>1thena=100
2055 ifa=100thenprint"[212]he [211]murk sees the poison and says:"
2056 ifa=100thenprint"[212]rying to poison me, huh? [201] will kill"
2057 ifa=100thenprint"you for that! [200]e points at you, and youcollapse into ashes."
2060 ifa=100then1500
2200 l=x:xx=1:return
3000 rem pick up
3005 i=fw%(1)
3007 ifi=51ori=52thenprint"[196]on't be ridiculous!":return
3010 ifi=21and(l=39orl=40)then13500
3020 ifi=4andl=17then13500
3030 ifi<1ori>nithenprint"[206]o such thing here.":return
3040 ifil%(i)=-2andre%(i)=2theni=2
3045 gosub11000:ifr=0thenprint"[206]o such thing here.":return
3050 ifil%(i)=-3andmx%>1andre%(i)>0thenprint"[201]t cannot be separated from the other"
3055 ifil%(i)=-3andmx%>1andre%(i)>0thenprint"stuff in the bowl.":return
3060 ifr=2thenprint"[217]ou're already carrying it.":return
3080 gosub3500:ifrtthenreturn
3095 ifre%(i)=2then3300
3097 ifil%(i)=-3andre%(i)>0thenmx%=mx%-1
3100 il%(i)=0
3110 print"[207][203]."
3140 return
3300 rem into bottle
3310 ifil%(2)<>0thenprint"[217]ou need a bottle.":return
3320 b=1
3330 ifil%(b)=-2thenprint"[212]he bottle is full.":return
3340 b=b+1:ifb<=nithen3330
3350 il%(i)=-2:goto3110
3500 rem pickup conditions
3505 rt=0
3510 ifiw(i)<0thenprint"[201]t is securely fastened.":rt=1:return
3520 ifl=38andi=13andsm%=0thenprint"[212]he [211]murk won't let you!":rt=1:return
3530 ifl=11andfw%(1)=19andt%=0thenprint"[212]he tiger is in the way!":rt=1:return
3540 ifi=8thenprint"[212]he ghoul won't let you!":rt=1:return
3580 ifsc%(i)>0thensc%=sc%+sc%(i)/2:sc%(i)=-sc%(i)
3585 ifsc%(i)<0andl=1thensc%=sc%-sc%(fw%(1))/-2
3590 return
4000 rem drop
4005 i=fw%(1)
4010 ifi<1ori>nithenprint"[217]ou are not carrying it.":return
4012 ifi=7andl=40then4020
4015 ifil%(i)=-2andre%(i)=2theni=2
4020 gosub11000
4024 ifil%(i)=-3andre%(i)>0andmx%>1then4100
4030 ifr<2thenprint"[217]ou are not carrying it.":return
4032 ifi=7andl=40then4150
4037 ifil%(i)=-3andre%(i)>0thenmx%=mx%-1
4040 il%(i)=l
4050 print"[207][203]."
4055 ifi=20andl=11then4200
4057 ifre%(i)=2thenprint"[201]t seeps into the ground and is lost.":il%(i)=-1:return
4060 ifsc%(i)<0andl=1thensc%=sc%+sc%(i)/-2
4070 return
4100 print"[201]t cannot be separated from the other stuff in the bowl.":return
4150 print"[201]t goes into the water. [211]oon you hear"
4160 print"a dreadful shriek coming from the west, followed by total silence."
4170 sm%=1:il%(7)=-1:sc%=sc%+400:return
4200 print"[212]he tiger gobbles it up and curls into a corner, sleeping contentfully."
4210 t%=1:il%(i)=-1:sc%=sc%+100
4220 return
5000 rem look
5005 iffw%(1)>0then8000
5010 xx=1
5020 l%(l)=0
5030 return
5500 rem inv
5505 x=0
5510 print "[217]ou are carrying:"
5520 fora=1toni
5525 ifa=2andil%(a)=0thengosub5600:goto5540
5527 ifa=23andil%(a)=0thengosub5700:goto5540
5530 ifil%(a)=0thenprint" "id$(a):x=1
5540 nexta
5550 ifx=0thenprint"[206]othing."
5560 return
5600 rem bottle
5605 x=1
5610 b=1
5620 ifil%(b)=-2then5640
5630 b=b+1:ifb>nithenprint" [194]ottle":return
5635 goto5620
5640 print" [194]ottle of "id$(b):return
5700 rem bowl
5705 x=1
5710 b=1
5720 ifil%(b)=-3then5750
5730 b=b+1:ifb>nithenprint" [194]owl":return
5740 goto5720
5750 print" [194]owl containing:"
5760 forc=btoni
5770 ifc=2andil%(c)=-3thenprint" ";:gosub5600:goto5790
5780 ifil%(c)=-3thenprint" "id$(c)
5790 nextc:return
6000 rem save game
6010 print"[197]nter filename. ([196]efault: smurk.save)":inputf$
6015 iff$=""thenf$="smurk.save"
6017 open15,8,15:print#15,"s:"f$:close15
6020 open2,8,2,f$+",s,w"
6040 print#2,l:forb=1toni:print#2,il%(b):nextb:print#2,t
6045 print#2,sc%:print#2,sm%:print#2,t%
6060 forb=1toni:print#2,sc%(b):nextb
6070 print#2,lo%:print#2,mx%:print#2,pn%
6090 close2
6100 print "[207][203].":return
6500 rem load game
6510 print"[197]nter filename. ([196]efault: smurk.save)":inputf$
6515 iff$=""thenf$="smurk.save"
6520 open15,8,15
6530 open2,8,2,f$+",s,r"
6540 gosub 6900
6550 input#2,l:forb=1toni:input#2,il%(b):nextb:input#2,t
6560 input#2,sc%:input#2,sm%:input#2,t%
6565 forb=1toni:input#2,sc%(b):nextb
6570 input#2,lo%:input#2,mx%
6580 input#2,pn%
6590 close2:close15
6600 return
6900 input#15,a$,b$,c$,d$
6910 ifval(a$)>0thenprint"[199]ame not found.":fora=1to100:nexta:run
6920 return
7000 rem mix
7003 ifil%(18)<>0andil%(18)<>lthenprint"[217]ou have nothing to stir with.":return
7005 ifil%(23)<>0andil%(23)<>lthenprint"[217]ou have no mixing bowl.":return
7007 ifil%(28)=-3thenil%(28)=il%(4):il%(4)=-3
7010 x=0
7020 fora=3to6:ifil%(a)<>-3thenx=1
7030 nexta:ifx<>0then7100
7040 ifil%(19)<>-3then7100
7045 print"[207][203]."
7050 print"[217]ou have a poisonous mixture!"
7060 fora=3to6:il%(a)=-1:nexta:il%(19)=-1
7070 il%(7)=-3
7080 return
7100 rem
7110 print"[206]othing interesting is produced.":return
8000 rem read/examine
8002 iffw%(1)<1orfw%(1)>nithenprint"[206]o such thing here.":return
8005 i=fw%(1):gosub11000:ifr=0thenprint"[206]o such thing here.":return
8010 iffw%(1)=15theni=16:gosub11000:ifr=0then8500
8020 iffw%(1)=15then8550
8030 iffw%(1)=16thenprint"[201]t gives the [197]nglish translations of"
8040 iffw%(1)=16thenprint"many [211]anskrit words, and vice versa.":return
8490 print"[212]here is nothing interesting abou