home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1985 May / 1985-05.d64 / z (.txt) < prev   
Commodore BASIC  |  2022-09-20  |  9KB  |  267 lines

  1. 1 poke56,63:poke55,229:clr:poke36879,8:om=4
  2. 2 gosub15:bb=y:gosub15:cc=y:gosub15:dd=y
  3. 3 print"[147]":restore:fory=16357to16383:readz:pokey,z:next:gosub171:goto152
  4. 4 poke36869,205:a=9:b=9:deffnc(d)=4096+a+22*b
  5. 5 forz=1to3:gosub15:e(z)=y:next:gg=483
  6. 6 poke36878,15
  7. 7 forz=1to4:gosub16:e1(z)=y:e2(z)=e1(z):next:f=33792
  8. 8 g=4096:h=4579:y=rnd(-ti)
  9. 9 i=4117:j=4558:gosub15:n=y:n1=int(rnd(.)*gg)+g:gosub15:ee=y
  10. 10 gosub15:cu=y
  11. 11 gosub14:x1=y:gosub14:o1=y:gosub14:p1=y:fory=832to936:readz:pokey,z:next
  12. 12 gosub14:s1=y:gosub14:t1=y:gosub14:u1=y:gosub14:v1=y:gosub14:fa=y:gosub14:w1=y
  13. 13 gosub16:by=y:bx=y::gosub16:cy=y:cx=y:gosub16:dy=y:dx=y:gosub16:ey=y:ex=y:goto17
  14. 14 y=int(rnd(.)*gg)+g:return
  15. 15 y=int(rnd(.)*40)+1:return
  16. 16 y=int(rnd(.)*20)+1:return
  17. 17 gosub14:q1=y:gosub14:r1=y:deffna1(d)=4096+e1(y)+22*e2(y):deffna2(d)=4096+bx+22*by
  18. 18 deffna3(d)=4096+cx+22*cy:deffna4(d)=4096+dx+22*dy:deffna5(d)=4096+ex+22*ey
  19. 19 d1=4106:d2=4568:d4=4337:d3=4316:deffna7(d)=4096+gh(z)+22*gz(z):ti$="000000"
  20. 20 gosub263:print"[147]":ifk=1ork=9ork=17ork>24andk<28ork>32andk<38ork=3then261
  21. 21 print"cccccccccccccccccccccc"
  22. 22 ifk=12ork=25ork=26ork>32andk<37ork=3ork=6ork=2then24
  23. 23 fory=itohstep22:pokey,3:pokey+f,2:next
  24. 24 ifk=1ork=9ork=11ork=25ork>32andk<36ork=17then26
  25. 25 fory=jtoh:pokey,3:pokey+f,2:next
  26. 26 ifk=1ork=3ork=4ork=7ork=9ork=13ork=17ork>24andk<28ork>32andk<38then28
  27. 27 fory=gtojstep22:pokey,3:pokey+f,2:next
  28. 28 ifk<>10andk<>16andk<>13andk<>25then30
  29. 29 forz=1toint(rnd(.)*15)+15:y=int(rnd(.)*gg)+g:pokey,7:pokey+f,0:next
  30. 30 ifk>3andk<8ork=15ork=18ork>21andk<25ork=32thenpoked1,11:poked1+f,0
  31. 31 ifk>11andk<16ork=23ork=26ork>29andk<33ork=40thenpoked2,11:poked2+f,0
  32. 32 ifk=5ork=15ork=16ork>18andk<21ork=22ork=24ork=29ork>37andk<41thenfl=1
  33. 33 ifflthenpoked3,11:poked3+f,0:fl=0
  34. 34 ifk=4ork=14ork=15ork=18ork=19ork=23ork=28ork=21ork>36andk<40thenpoked4,11:poked4+f,0
  35. 35 ifk=16andlk=0thenpokeh-88,10
  36. 36 rr=0:ifk=39ork=29ork=31ork=20thenrr=9
  37. 37 ifi(2)=9then183
  38. 38 ifk=5thenfory=gtohstep25:pokey,3:pokey+f,4:next
  39. 39 ifk=8thenfory=gtohstep7:pokey,3:pokey+f,2:next
  40. 40 ifk=16thenfory=gtohstep18:pokey,3:pokey+f,2:next
  41. 41 ifk=12thenfory=itojstep21:pokey,3:pokey+f,4:next
  42. 42 ifk<>30then44
  43. 43 fory=gtohstep23:pokey,3:pokey+f,3:next:fory=itojstep21:pokey,3:pokey+f,3:next
  44. 44 ifk<>18then46
  45. 45 fory=d3tod4-2:pokey,3:pokey+f,2:next:fory=d3+10tod2step22:pokey,3:pokey+f,2:next
  46. 46 ifk=20andi(7)=9thenpoked4,9:poked4+f,3
  47. 47 ifk=21andi(7)=9thenpoked3,9:poked3+f,3
  48. 48 ifk=5andi(6)=9thenpoked4,9:poked4+f,4
  49. 49 ifk=6andi(6)=9thenpoked3,9:poked3+f,4
  50. 50 ifk=11thenfory=d1+44tod2step22:pokey,3:pokey+f,4:next
  51. 51 ifk<>3then53
  52. 52 fory=d1tod2step22:pokey,3:pokey+f,4:next:fory=d3tod3+10:pokey,3:pokey+f,4:next
  53. 53 ifk=2thenfory=d3+2tod4:pokey,3:pokey+f,4:next
  54. 54 ifk<>40then57
  55. 55 fory=d1+43tod2-23step22:pokey,3:pokey+f,2:next
  56. 56 fory=d3+2tod4-2:pokey,3:pokey+f,2:next
  57. 57 ifk=14thenfory=gtohstep5:pokey,3:pokey+f,2:next:poked4-1,32:poked2-22,32
  58. 58 ifk<>23then60
  59. 59 fory=d1+44tod2-44step22:pokey,3:pokey+f,2:next:fory=d3tod4-2:pokey,3:pokey+f,2:next
  60. 60 ifk>50thenpoke36879,76:print"[147]"
  61. 61 poke36880,5:poke36881,25:ifk=10ork=13ork=16ork=25thengr=k
  62. 62 ifk<>22then65
  63. 63 fory=d3+2tod2-44step23:pokey,3:pokey+f,3:next
  64. 64 fory=d1+44tod4-2step23:pokey,3:pokey+f,3:next
  65. 65 fory=1to3:iftr(y)=kthenpoketa(y),tb(y):poketa(y)+f,0:next
  66. 66 ifk=15thenfory=itod4-10step21:pokey,3:pokey+f,2:next:fory=d4-10tohstep23:pokey,3
  67. 67 ifcu=kthenck=9:poke38399,7:sys16357
  68. 68 ifpeek(fnc(d))=3thenk=33:goto20
  69. 69 poke36879,25+int(rnd(.)*7)
  70. 70 fory=4580to4601:pokey+f,4:next:ifi(1)=9thenpoke4581,2:o=0
  71. 71 ifi(2)=9thenpoke4583,5:p=0
  72. 72 ifi(3)=9thenpoke4585,6:q=0
  73. 73 ifi(4)=9thenpoke4587,7:r=0
  74. 74 ifi(5)=9thenpoke4589,8:s=0
  75. 75 ifi(6)=9thenpoke4591,12:t=0
  76. 76 ifi(7)=9thenpoke4593,12:poke4593+f,3:u=0
  77. 77 ifi(8)=9thenpoke4595,19:v=0
  78. 78 ifi(10)=9thenpoke4599,6:poke4599+f,0:ff=0
  79. 79 ifi(9)=9thenpoke4597,20:x=0:goto220
  80. 80 ifi(9)=9then82
  81. 81 ifk=37ork=28ork=29ork=8ork=10ork=2ork=1thenpoke38399,0:sys16357:poke36879,8
  82. 82 poke36869,205:sys832:ma=0:mb=0:ifpeek(830)=0then241
  83. 83 pokefnc(d),32:poke36877,0:ifpeek(830)=1thenmb=-1:ifck=9thenmb=1
  84. 84 ifpeek(830)=3thenma=1:ifck=9thenma=-1
  85. 85 ifpeek(830)=5thenmb=1:ifck=9thenmb=-1
  86. 86 ifpeek(830)=7thenma=-1:ifck=9thenma=1
  87. 87 a=a+ma:b=b+mb:ifpeek(fnc(d))=32then102
  88. 88 gosub205:ifpeek(fnc(d))=3andi(1)=0then244
  89. 89 ifpeek(fnc(d))=4andi(8)=0then244
  90. 90 ifpeek(fnc(d))=7andi(4)=0andr1<>fnc(d)then188
  91. 91 poke36876,int(rnd(.)*127)+128:iffnc(d)=o1ando=ktheni(1)=9:o=0
  92. 92 iffnc(d)=p1andp=ktheni(2)=9:p=0
  93. 93 iffnc(d)=q1andq=ktheni(3)=9:q=0
  94. 94 iffnc(d)=r1andr=ktheni(4)=9:r=0
  95. 95 iffnc(d)=s1ands=ktheni(5)=9:s=0
  96. 96 iffnc(d)=t1andt=ktheni(6)=9:t=0
  97. 97 iffnc(d)=u1andu=ktheni(7)=9:u=0
  98. 98 iffnc(d)=x1andx=ktheni(9)=9:x=0
  99. 99 iffnc(d)=v1andv=ktheni(8)=9:v=0
  100. 100 iffnc(d)=faandff=ktheni(10)=9:ff=0
  101. 101 iffnc(d)=w1andw=kthenk=int(rnd(.)*40)+1:goto21
  102. 102 poke36876,0:ifa>21ora<0orb>21orb<0then246
  103. 103 pokefnc(d),0:pokefnc(d)+f,0
  104. 104 fory=1to3:ife(y)=kthen106
  105. 105 next:goto112
  106. 106 y=int(rnd(.)*4)+1:pokefna1(d),32:ife1(y)<athene1(y)=e1(y)+1
  107. 107 ife1(y)>athene1(y)=e1(y)-1
  108. 108 ife2(y)>bthene2(y)=e2(y)-1
  109. 109 ife2(y)<bthene2(y)=e2(y)+1
  110. 110 pokefna1(d),18:pokefna1(d)+f,6
  111. 111 iffna1(d)=fnc(d)then188
  112. 112 ifk<>bbthen119
  113. 113 ma=0:mb=0:pokefna2(d),3:ifbx<athenma=1:goto117
  114. 114 ifbx>athenma=-1:goto117
  115. 115 ifby>bthenmb=-1
  116. 116 ifby<bthenmb=1
  117. 117 by=by+mb:bx=bx+ma:ifpeek(fna2(d))=4orpeek(fna2(d))=7thenby=by-mb:bx=bx-ma
  118. 118 pokefna2(d),13:pokefna2(d)+f,2:iffna2(d)=fnc(d)then188
  119. 119 ifk<>ccthen126
  120. 120 pokefna3(d),32:ifcx<athenma=1
  121. 121 ifcx>athenma=-1
  122. 122 ifcy>bthenmb=-1
  123. 123 ifcy<bthenmb=1
  124. 124 cx=cx+ma:cy=cy+mb:ifpeek(fna3(d))=3thencx=cx-ma:cy=cy-mb
  125. 125 pokefna3(d),14:pokefna3(d)+f,0:iffna3(d)=fnc(d)then188
  126. 126 ifk<>ddthen133
  127. 127 pokefna4(d),32:pokefna4(d)-1,32:ifdx<athendx=dx+1:goto129
  128. 128 dx=dx-1
  129. 129 ifdy<bthendy=dy+1:goto131
  130. 130 dy=dy-1
  131. 131 pokefna4(d),17:pokefna4(d)-1,16:pokefna4(d)-1+f,5:pokefna4(d)+f,5
  132. 132 iffna4(d)=fnc(d)then188
  133. 133 ifk<>eethen141
  134. 134 pokefna5(d),32:ifex<athenma=1
  135. 135 ifex>athenma=-1
  136. 136 ifey>bthenmb=-1
  137. 137 ifey<bthenmb=1
  138. 138 ex=ex+ma:ey=ey+mb
  139. 139 ifpeek(fna5(d))=3orpeek(fna5(d))=4orpeek(fna5(d))=7thenex=ex-ma:ey=ey-mb
  140. 140 pokefna5(d),0:pokefna5(d)+f,3:iffna5(d)=fnc(d)thenz=int(rnd(.)*10)+1:i(z)=0:ee=0
  141. 141 ifrr=0then145
  142. 142 z=int(rnd(.)*gg)+g:pokez,3:pokez+f,7:ifz=fnc(d)then188
  143. 143 z=int(rnd(.)*8)+1:poke36880,z:y=int(rnd(.)*9)+21:poke36881,y:poke36876,128
  144. 144 poke36877,128
  145. 145 ifk<>grori(4)=9then82
  146. 146 z=int(rnd(.)*13)+1:pokefna7(d),32:ifgh(z)<athengh(z)=gh(z)+1
  147. 147 ifgh(z)>athengh(z)=gh(z)-1
  148. 148 ifgz(z)<bthengz(z)=gz(z)+1
  149. 149 ifgz(z)>bthengz(z)=gz(z)-1
  150. 150 pokefna7(d),0:pokefna7(d)+f,2:iffna7(d)=fnc(d)then188
  151. 151 goto82
  152. 152 print"[158][147]the sword"
  153. 153 print"press f1 to start in      the forest."
  154. 154 print"press f3 to be placed   randomly in a room."
  155. 155 print"press f5 to start with   a treasure."
  156. 156 gett$:ift$=""then156
  157. 157 ift$="[133]"thenk=33:m=4:goto4
  158. 158 ift$<>"[134]"then161
  159. 159 gosub15:ify=8ory=10ory=12ory=30ory=40then159
  160. 160 k=y:m=4:goto4
  161. 161 ift$="[135]"then163
  162. 162 goto152
  163. 163 print"[147]   treasures":print"0. random"
  164. 164 print"1. boots":print"2. wand of secrets":print"3. globe":print"4. cross"
  165. 165 print"5. wand of the way":print"6. purple key":print"7. blue key"
  166. 166 print"8. axe":print"9. torch"
  167. 167 gett$:ift$=""then167
  168. 168 ift$<"0"ort$>"9"then152
  169. 169 hh=val(t$):ifhh=0thenhh=int(rnd(.)*9)+1
  170. 170 i(hh)=9:goto152
  171. 171 gosub15:n=y:ifn=1orn=7orn=6orn=9orn>13andn<21orn>22andn<30orn>30then171
  172. 172 gosub15:o=y:ifo=1oro=9oro=17oro>24ando<28oro>32ando<38then172
  173. 173 gosub15:p=y:ifp=10orp=8orp=28orp=29then173
  174. 174 gosub15:q=y:ifq=1orq=9orq=17orq>24andq<28orq>32andq<38then174
  175. 175 gosub15:r=y:gosub15:s=y:gosub15:x=y:gosub15:w=y
  176. 176 gosub15:t=y:ift>1andt<6ort>10andt<14then176
  177. 177 gosub15:v=y:ifv=1orv=9orv=17orv>24andv<28orv>32andv<38then177
  178. 178 gosub15:u=y:ifu>1andu<6oru>10andu<14oru=21oru=22oru=30then178
  179. 179 gosub15:ff=y:ify=1ory=2ory=10ory=8ory=37ory=28ory=29then179
  180. 180 forz=1to3:aa(z)=int(rnd(.)*gg)+g:next
  181. 181 forz=1to3:gosub15:tr(z)=y:gosub14:ta(z)=y:next:tb(1)=6:tb(2)=19:tb(3)=2
  182. 182 dimgz(13):dimgh(13):forz=1to13:gosub16:gz(z)=y:gh(z)=y:next:return
  183. 183 ifk=10ork=8thenpoked3,42
  184. 184 ifk=9ork=7thenpoked4,42
  185. 185 ifk=24ork=28ork=37thenpoked2,42
  186. 186 ifk=16ork=20ork=29th