home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 3 / 003.d81 / smurk (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  22KB  |  732 lines

  1. 1 ifpeek(52016)<>32orpeek(52040)<>245thenload"linput.pr",8,1
  2. 2 rem smurk
  3. 3 rem by daniel tobias
  4. 4 rem c64 version 1.1
  5. 5 rem 6/15/84
  6. 7 na$="smurk"
  7. 8 poke 53280,5:poke53281,1:print"[144]"
  8. 10 print"":li=52016
  9. 15 dim lv%(100,8),ld$(100,1),id$(50),il%(50),sc%(50),iw(50),l%(100)
  10. 17 dim wd$(100),w%(100,1),fw%(2)
  11. 18 dimfb%(50),re%(50)
  12. 20 gosub 18000:gosub 19000
  13. 60 print"[147]"
  14. 100 rem start
  15. 108 xx=1
  16. 110 ifsc%>=1000thenprint"[217]ou win!":goto1500
  17. 115 ifxx=1thengosub1000
  18. 120 gosub500
  19. 125 xx=xx+1:ifxx>5thenxx=1
  20. 130 iffw%(0)=0thenprint"[215]hat?":goto110
  21. 140 onfw%(0)gosub2000,3000,4000,5000,5500,6000,7000,8000,9000,9500
  22. 142 iffw%(0)>10thenonfw%(0)-10gosub13000,13500,14500,15000,15500,16000,16500
  23. 143 iffw%(0)=18thengosub10000
  24. 144 iffw%(0)=19thengosub17000
  25. 145 iffw%(0)=99then1500
  26. 150 t=t+1
  27. 160 goto110
  28. 200 rem convert to lower case
  29. 220 for ip=1tolen(i$)
  30. 230 ch$=mid$(i$,ip,1)
  31. 240 ifch$>="[193]"andch$<="[218]"theni$=left$(i$,ip-1)+chr$(asc(ch$)-128)+mid$(i$,ip+1)
  32. 245 ifch$=chr$(160)theni$=left$(i$,ip-1)+" "+mid$(i$,ip+1)
  33. 250 ifch$<"a"theni$=left$(i$,ip-1)+" "+mid$(i$,ip+1)
  34. 260 next ip
  35. 270 return
  36. 330 goto63000
  37. 500 rem handle input
  38. 505 fw%(0)=0:fw%(1)=0
  39. 506 fw%(2)=0
  40. 510 print"-->";:sysli,b$:i$=b$+"":print
  41. 515 if i$="" then 510
  42. 518 gosub 200
  43. 520 wd$="":a=1
  44. 530 if mid$(i$,a,1)=" " then 600
  45. 540 wd$=wd$+mid$(i$,a,1)
  46. 550 a=a+1:ifa<=len(i$)then530
  47. 600 rem found word
  48. 610 forb=1tonw:ifwd$(b)=wd$thengosub643
  49. 620 nextb:wd$="":a=a+1
  50. 630 ifa>len(i$)thenreturn
  51. 640 goto530
  52. 643 ifw%(b,1)>100andfw%(1)<>0thenreturn
  53. 646 ifw%(b,1)>100andfw%(0)=0thenfw%(0)=1
  54. 650 forc=0to1
  55. 655 ifc=1andfw%(c)>0and(w%(b,c)=2orw%(b,c)=23orw%(b,c)=21)then700
  56. 660 ifw%(b,c)>=0thenfw%(c)=w%(b,c)
  57. 670 nextc
  58. 680 return
  59. 700 fw%(2)=w%(b,c):goto670
  60. 1000 rem print description
  61. 1005 print
  62. 1006 ifl=11orl=38then1010
  63. 1007 ifl>5andlo%=0thenprint"[144][201]t is too dark to see.":return
  64. 1008 ifl>5theni=1:gosub11000:ifr=0thenprint"[144][201]t is too dark to see.":return
  65. 1010 printld$(l,l%(l))
  66. 1014 print
  67. 1015 l%(l)=1
  68. 1020 print"[207]pen pathways: ";:fora=1to8:iflv%(l,a)<>0thenprintdn$(a)" ";
  69. 1025 nexta
  70. 1030 print
  71. 1040 print"[214]isible objects:"
  72. 1045 x=0
  73. 1050 fora=1toni
  74. 1055 ifa=2andil%(a)=lthengosub5600:goto1070
  75. 1057 ifa=23andil%(a)=lthengosub5700:goto1070
  76. 1060 if il%(a)=lthenprint" "id$(a):x=1
  77. 1070 nexta
  78. 1080 ifx=0thenprint"[212]here are none."
  79. 1100 ifl=11andt%=0thenprint"[212]here is a ferocious tiger here!"
  80. 1110 ifl=11andt%<>0thenprint"[193] contented-looking tiger dozes here."
  81. 1120 ifl=38andsm%=0thenprint"[212]he [211]murk is here!"
  82. 1130 ifl=38andsm%<>0thenprint"[212]he dead body of the [211]murk lies here."
  83. 1480 print
  84. 1490 return
  85. 1500 rem end
  86. 1505 print"[144]"
  87. 1510 print:print"[211]top after"t"turns.":print"[198]inal score:"sc%"out of 1000.":print
  88. 1520 forls=1to2000:nextls:goto63000
  89. 2000 rem move
  90. 2005 iffw%(1)<101orfw%(1)>108thenprint"[199]o where?":return
  91. 2010 x=lv%(l,fw%(1)-100)
  92. 2020 ifx<0orx>nlthenprint"[206]ot defined yet.":return
  93. 2030 ifx=0thenprint"[217]ou can't go that way.":return
  94. 2040 ifl=3andx=3thenifrnd(0)<.37thenx=2
  95. 2045 a=0
  96. 2050 ifx=38theni=7:gosub11000:ifr>1thena=100
  97. 2055 ifa=100thenprint"[212]he [211]murk sees the poison and says:"
  98. 2056 ifa=100thenprint"[212]rying to poison me, huh?  [201] will kill"
  99. 2057 ifa=100thenprint"you for that!  [200]e points at you, and youcollapse into ashes."
  100. 2060 ifa=100then1500
  101. 2200 l=x:xx=1:return
  102. 3000 rem pick up
  103. 3005 i=fw%(1)
  104. 3007 ifi=51ori=52thenprint"[196]on't be ridiculous!":return
  105. 3010 ifi=21and(l=39orl=40)then13500
  106. 3020 ifi=4andl=17then13500
  107. 3030 ifi<1ori>nithenprint"[206]o such thing here.":return
  108. 3040 ifil%(i)=-2andre%(i)=2theni=2
  109. 3045 gosub11000:ifr=0thenprint"[206]o such thing here.":return
  110. 3050 ifil%(i)=-3andmx%>1andre%(i)>0thenprint"[201]t cannot be separated from the other"
  111. 3055 ifil%(i)=-3andmx%>1andre%(i)>0thenprint"stuff in the bowl.":return
  112. 3060 ifr=2thenprint"[217]ou're already carrying it.":return
  113. 3080 gosub3500:ifrtthenreturn
  114. 3095 ifre%(i)=2then3300
  115. 3097 ifil%(i)=-3andre%(i)>0thenmx%=mx%-1
  116. 3100 il%(i)=0
  117. 3110 print"[207][203]."
  118. 3140 return
  119. 3300 rem into bottle
  120. 3310 ifil%(2)<>0thenprint"[217]ou need a bottle.":return
  121. 3320 b=1
  122. 3330 ifil%(b)=-2thenprint"[212]he bottle is full.":return
  123. 3340 b=b+1:ifb<=nithen3330
  124. 3350 il%(i)=-2:goto3110
  125. 3500 rem pickup conditions
  126. 3505 rt=0
  127. 3510 ifiw(i)<0thenprint"[201]t is securely fastened.":rt=1:return
  128. 3520 ifl=38andi=13andsm%=0thenprint"[212]he [211]murk won't let you!":rt=1:return
  129. 3530 ifl=11andfw%(1)=19andt%=0thenprint"[212]he tiger is in the way!":rt=1:return
  130. 3540 ifi=8thenprint"[212]he ghoul won't let you!":rt=1:return
  131. 3580 ifsc%(i)>0thensc%=sc%+sc%(i)/2:sc%(i)=-sc%(i)
  132. 3585 ifsc%(i)<0andl=1thensc%=sc%-sc%(fw%(1))/-2
  133. 3590 return
  134. 4000 rem drop
  135. 4005 i=fw%(1)
  136. 4010 ifi<1ori>nithenprint"[217]ou are not carrying it.":return
  137. 4012 ifi=7andl=40then4020
  138. 4015 ifil%(i)=-2andre%(i)=2theni=2
  139. 4020 gosub11000
  140. 4024 ifil%(i)=-3andre%(i)>0andmx%>1then4100
  141. 4030 ifr<2thenprint"[217]ou are not carrying it.":return
  142. 4032 ifi=7andl=40then4150
  143. 4037 ifil%(i)=-3andre%(i)>0thenmx%=mx%-1
  144. 4040 il%(i)=l
  145. 4050 print"[207][203]."
  146. 4055 ifi=20andl=11then4200
  147. 4057 ifre%(i)=2thenprint"[201]t seeps into the ground and is lost.":il%(i)=-1:return
  148. 4060 ifsc%(i)<0andl=1thensc%=sc%+sc%(i)/-2
  149. 4070 return
  150. 4100 print"[201]t cannot be separated from the other   stuff in the bowl.":return
  151. 4150 print"[201]t goes into the water.  [211]oon you hear"
  152. 4160 print"a dreadful shriek coming from the west, followed by total silence."
  153. 4170 sm%=1:il%(7)=-1:sc%=sc%+400:return
  154. 4200 print"[212]he tiger gobbles it up and curls into  a corner, sleeping contentfully."
  155. 4210 t%=1:il%(i)=-1:sc%=sc%+100
  156. 4220 return
  157. 5000 rem look
  158. 5005 iffw%(1)>0then8000
  159. 5010 xx=1
  160. 5020 l%(l)=0
  161. 5030 return
  162. 5500 rem inv
  163. 5505 x=0
  164. 5510 print "[217]ou are carrying:"
  165. 5520 fora=1toni
  166. 5525 ifa=2andil%(a)=0thengosub5600:goto5540
  167. 5527 ifa=23andil%(a)=0thengosub5700:goto5540
  168. 5530 ifil%(a)=0thenprint" "id$(a):x=1
  169. 5540 nexta
  170. 5550 ifx=0thenprint"[206]othing."
  171. 5560 return
  172. 5600 rem bottle
  173. 5605 x=1
  174. 5610 b=1
  175. 5620 ifil%(b)=-2then5640
  176. 5630 b=b+1:ifb>nithenprint" [194]ottle":return
  177. 5635 goto5620
  178. 5640 print" [194]ottle of "id$(b):return
  179. 5700 rem bowl
  180. 5705 x=1
  181. 5710 b=1
  182. 5720 ifil%(b)=-3then5750
  183. 5730 b=b+1:ifb>nithenprint" [194]owl":return
  184. 5740 goto5720
  185. 5750 print" [194]owl containing:"
  186. 5760 forc=btoni
  187. 5770 ifc=2andil%(c)=-3thenprint" ";:gosub5600:goto5790
  188. 5780 ifil%(c)=-3thenprint"  "id$(c)
  189. 5790 nextc:return
  190. 6000 rem save game
  191. 6010 print"[197]nter filename. ([196]efault: smurk.save)":inputf$
  192. 6015 iff$=""thenf$="smurk.save"
  193. 6017 open15,8,15:print#15,"s:"f$:close15
  194. 6020 open2,8,2,f$+",s,w"
  195. 6040 print#2,l:forb=1toni:print#2,il%(b):nextb:print#2,t
  196. 6045 print#2,sc%:print#2,sm%:print#2,t%
  197. 6060 forb=1toni:print#2,sc%(b):nextb
  198. 6070 print#2,lo%:print#2,mx%:print#2,pn%
  199. 6090 close2
  200. 6100 print "[207][203].":return
  201. 6500 rem load game
  202. 6510 print"[197]nter filename. ([196]efault: smurk.save)":inputf$
  203. 6515 iff$=""thenf$="smurk.save"
  204. 6520 open15,8,15
  205. 6530 open2,8,2,f$+",s,r"
  206. 6540 gosub 6900
  207. 6550 input#2,l:forb=1toni:input#2,il%(b):nextb:input#2,t
  208. 6560 input#2,sc%:input#2,sm%:input#2,t%
  209. 6565 forb=1toni:input#2,sc%(b):nextb
  210. 6570 input#2,lo%:input#2,mx%
  211. 6580 input#2,pn%
  212. 6590 close2:close15
  213. 6600 return
  214. 6900 input#15,a$,b$,c$,d$
  215. 6910 ifval(a$)>0thenprint"[199]ame not found.":fora=1to100:nexta:run
  216. 6920 return
  217. 7000 rem mix
  218. 7003 ifil%(18)<>0andil%(18)<>lthenprint"[217]ou have nothing to stir with.":return
  219. 7005 ifil%(23)<>0andil%(23)<>lthenprint"[217]ou have no mixing bowl.":return
  220. 7007 ifil%(28)=-3thenil%(28)=il%(4):il%(4)=-3
  221. 7010 x=0
  222. 7020 fora=3to6:ifil%(a)<>-3thenx=1
  223. 7030 nexta:ifx<>0then7100
  224. 7040 ifil%(19)<>-3then7100
  225. 7045 print"[207][203]."
  226. 7050 print"[217]ou have a poisonous mixture!"
  227. 7060 fora=3to6:il%(a)=-1:nexta:il%(19)=-1
  228. 7070 il%(7)=-3
  229. 7080 return
  230. 7100 rem
  231. 7110 print"[206]othing interesting is produced.":return
  232. 8000 rem read/examine
  233. 8002 iffw%(1)<1orfw%(1)>nithenprint"[206]o such thing here.":return
  234. 8005 i=fw%(1):gosub11000:ifr=0thenprint"[206]o such thing here.":return
  235. 8010 iffw%(1)=15theni=16:gosub11000:ifr=0then8500
  236. 8020 iffw%(1)=15then8550
  237. 8030 iffw%(1)=16thenprint"[201]t gives the [197]nglish translations of"
  238. 8040 iffw%(1)=16thenprint"many [211]anskrit words, and vice versa.":return
  239. 8490 print"[212]here is nothing interesting abou