home *** CD-ROM | disk | FTP | other *** search
/ Tiger Disk 25 / Tiger_Disk_025_19xx_Tiger-Crew-Disk_de_Side_D.d64 / b.fahrseq (.txt) < prev    next >
Commodore BASIC  |  2023-02-26  |  7KB  |  282 lines

  1. 0 code=7*4096:vars=5*4096+6*256:gx=196
  2. 1 sys code,10:sys code,11,0,0,20,9
  3. 2 poke 53269,peek(53269)or12:poke 53252,gx:poke 53253,176:poke 56322,224
  4. 3 sys code,3:for i=1024+23*40 to 1024+25*40-1:poke i,96:next i
  5. 4 for i=1833 to 1848:poke i,96:next:sys code,6,5:poke 50170,56:poke 50171,60
  6. 5 poke 53276,peek(53276)or12
  7. 6 poke 53285,6:poke 53286,15
  8. 7 poke 53289,14:poke 53290,14
  9. 8 poke code+7,peek(code+7)or8
  10. 9 gosub 5000:mn=0:gosub 4000
  11. 10 s$(0)=" [176][195][195][195][195][195][195][195][174]        [214][174]"
  12. 20 s$(1)=" [194]   [214]   [194]   [176][195][195][195][174] [194]"
  13. 30 s$(2)="[176][189]   [194][176][178][195][219][195][195][195][189]   [194] [194]"
  14. 40 s$(3)="[194] [214][176][195][177][189][194] [194]       [194] [194]"
  15. 50 s$(4)="[194] [194][194]   [194] [173][174]      [194] [194]"
  16. 60 s$(5)="[194] [171][179]   [194]  [194]      [171][195][179]"
  17. 70 s$(6)="[194] [194][194]   [194] [176][177][178][195][174]   [194] [194]"
  18. 80 s$(7)="[194] [194][173][195][178][195][177][195][189] [194] [173][195][195][195][189] [194]"
  19. 90 s$(8)="[173][195][189]  [214]     [214]      [214][189]"
  20. 95 sp=0:ga=0:dr=0:jf=0
  21. 96 dr$="160520052405280532053605001004100810121016102010"
  22. 97 km$="00000400080012001600200024002800320036000005040508051205"
  23. 100 x=11:y=8:l$="+y":tr$="":d=1:tt=0
  24. 110 xa=11:ya=8:dr=0:km=0:vr=0:va=0
  25. 140 gosub 1320
  26. 150 rem *** neue richtung holen ***
  27. 160 gosub 770
  28. 170 if d=0 then goto 680
  29. 180 j=peek(56320)
  30. 185 if (j and 1)=0 then k$="w"
  31. 188 if (j and 2)=0 then k$="z"
  32. 190 if (j and 4)=0 then k$="a"
  33. 192 if (j and 8)=0 then k$="s"
  34. 195 if j=127 then 180
  35. 200 tr$=tr$+k$:ta=1:tm=len(tr$)
  36. 210 gosub 720:m$=""
  37. 220 rem *** sackgasse ***
  38. 230 if a$<>"[214]" then 280
  39. 240 r$=right$(l$,1)
  40. 250 l$=left$(l$,1)+"1":z=val(l$)
  41. 260 if z>0 then m$="-"+r$
  42. 270 if z<0 then m$="+"+r$
  43. 280 if m$="+x" then k$="s"
  44. 290 if m$="-x" then k$="a"
  45. 300 if m$="+y" then k$="z"
  46. 310 if m$="-y" then k$="w"
  47. 320 rem *** bewegung ***
  48. 330 if k$="a" then gosub 440
  49. 340 if k$="s" then gosub 500
  50. 350 if k$="w" then gosub 560
  51. 360 if k$="z" then gosub 620
  52. 370 gosub 1100
  53. 380 if x=xa and y=ya and d=1 then d=0:mn=1:gosub 4000:goto 150
  54. 381 if x<>xa or y<>ya then 390
  55. 382 if vr/va<=9 then 385
  56. 383 mn=6:gosub 4000:mn=7:gosub 4000:goto 386
  57. 385 mn=4:gosub 4000:mn=5:gosub 4000
  58. 386 end:sys code,1,"l.abrech",8
  59. 390 rem *** bis naechste abzweigung ***
  60. 400 gosub 720
  61. 410 if a$="[171]" or a$="[179]" or a$="[177]" or a$="[178]" or a$="[219]" then 150
  62. 420 if a$="[194]" or a$="[195]" then 220
  63. 430 gosub 1200 : goto 220
  64. 440 rem *** nach links fahren
  65. 450 if a$="[176]" then 620
  66. 460 if a$="[173]" then 560
  67. 470 if a$="[195]" or a$="[219]" or a$="[174]" or a$="[189]" then m$="-x"
  68. 480 if a$="[179]" or a$="[177]" or a$="[178]" then m$="-x"
  69. 490 return
  70. 500 rem *** nach rechts fahren
  71. 510 if a$="[174]" then 620
  72. 520 if a$="[189]" then 560
  73. 530 if a$="[195]" or a$="[219]" or a$="[176]" or a$="[173]" then m$="+x"
  74. 540 if a$="[171]" or a$="[177]" or a$="[178]" then m$="+x"
  75. 550 return
  76. 560 rem *** nach oben fahren
  77. 570 if a$="[176]" then 500
  78. 580 if a$="[174]" then 440
  79. 590 if a$="[194]" or a$="[219]" or a$="[173]" or a$="[189]" then m$="-y"
  80. 600 if a$="[177]" or a$="[171]" or a$="[179]" then m$="-y"
  81. 610 return
  82. 620 rem *** nach unten fahren
  83. 630 if a$="[173]" then 500
  84. 640 if a$="[189]" then 440
  85. 650 if a$="[194]" or a$="[219]" or a$="[176]" or a$="[174]" then m$="+y"
  86. 660 if a$="[178]" or a$="[171]" or a$="[179]" then m$="+y"
  87. 670 return
  88. 680 if ta>tm then 710
  89. 690 k$=mid$(tr$,ta,1)
  90. 700 ta=ta+1:goto 210
  91. 710 poke 56322,255:end
  92. 720 :
  93. 730 rem *** hole aktuelles element
  94. 740 :
  95. 750 a$=mid$(s$(y),x+1,1)
  96. 760 return
  97. 770 :
  98. 780 rem *** setze auto
  99. 790 :
  100. 845 if d=0 then 920
  101. 850 for ht=0 to za-1
  102. 860 if h(0,ht)=x-1 and h(1,ht)=y then 895
  103. 870 if h(0,ht)=x+1 and h(1,ht)=y then 895
  104. 880 if h(0,ht)=x and h(1,ht)=y-1 then 895
  105. 890 if h(0,ht)=x and h(1,ht)=y+1 then 895
  106. 891 next ht
  107. 892 return
  108. 895 h(2,ht)=1:sys code,23,8,2,h(0,ht)*2,h(1,ht)*2,2,2
  109. 900 goto 891
  110. 920 for ht=0 to za-1
  111. 930 if h(0,ht)=x-1 and h(1,ht)=y then 985
  112. 940 if h(0,ht)=x+1 and h(1,ht)=y then 985
  113. 950 if h(0,ht)=x and h(1,ht)=y-1 then 985
  114. 960 if h(0,ht)=x and h(1,ht)=y+1 then 985
  115. 970 next ht
  116. 980 return
  117. 985 h(2,ht)=2:sys code,23,8,4,h(0,ht)*2,h(1,ht)*2,2,2
  118. 986 goto 970
  119. 1100 :
  120. 1110 rem *** auto bewegen
  121. 1120 :
  122. 1130 if m$="" then return
  123. 1140 l$=m$
  124. 1150 r$=right$(m$,1)
  125. 1160 z=val(left$(m$,1)+"1")
  126. 1170 if r$="x" then x=x+z
  127. 1180 if r$="y" then y=y+z
  128. 1185 gosub 2000
  129. 1190 goto 770
  130. 1200 :
  131. 1210 rem *** kurven
  132. 1220 :
  133. 1230 if a$="[176]"andm$="-x" then m$="+y"
  134. 1240 if a$="[176]"andm$="-y" then m$="+x"
  135. 1250 if a$="[174]"andm$="+x" then m$="+y"
  136. 1260 if a$="[174]"andm$="-y" then m$="-x"
  137. 1270 if a$="[173]"andm$="+y" then m$="+x"
  138. 1280 if a$="[173]"andm$="-x" then m$="-y"
  139. 1290 if a$="[189]"andm$="+x" then m$="-y"
  140. 1300 if a$="[189]"andm$="+y" then m$="-x"
  141. 1310 return
  142. 1320 :
  143. 1330 rem *** haeuser highlighten
  144. 1340 :
  145. 1345 dim h(3,17)
  146. 1350 za=0:ze=int(rnd(0)*16)+1
  147. 1360 restore
  148. 1370 for i=0 to 16
  149. 1380 read x1,y1
  150. 1390 if rnd(0)<.5 then 1430
  151. 1400 h(0,za)=x1:h(1,za)=y1:h(2,za)=0
  152. 1405 sys code,23,8,0,x1*2,y1*2,2,2
  153. 1410 za=za+1
  154. 1420 if za=ze then return
  155. 1430 next i
  156. 1440 goto 1360
  157. 1450 data 01,04
  158. 1451 data 01,06
  159. 1452 data 01,07
  160. 1453 data 02,02
  161. 1454 data 04,05
  162. 1455 data 04,06
  163. 1456 data 06,05
  164. 1457 data 07,01
  165. 1458 data 10,03
  166. 1459 data 11,04
  167. 1460 data 11,05
  168. 1461 data 18,07
  169. 1462 data 18,06
  170. 1463 data 18,04
  171. 1464 data 18,02
  172. 1465 data 18,01
  173. 1466 data 07,08
  174. 2000 :
  175. 2010 rem *** move ***
  176. 2020 :
  177. 2030 if m$="+x" then dx=8:dy=0:poke 50170,55
  178. 2040 if m$="-x" then dx=-8:dy=0:poke 50170,55
  179. 2050 if m$="+y" then dx=0:dy=8:poke 50170,56
  180. 2060 if m$="-y" then dx=0:dy=-8:poke 50170,56
  181. 2070 :
  182. 2080 for c=0 to 1
  183. 2082 if c=0 then gosub 5000
  184. 2085 gx=gx+dx
  185. 2090 poke 53252,gx and 255
  186. 2095 poke code+7,int(gx/255)*4+8
  187. 2100 poke 53253,peek(53253)+dy
  188. 2110 if d=1 then 2170
  189. 2120 gosub 3000
  190. 2130 vz=(int(sp/40)-5)*-1
  191. 2140 gosub 3000
  192. 2150 vz=vz-1
  193. 2160 if vz>=0 then 2140
  194. 2170 next c
  195. 2180 return
  196. 3000 :
  197. 3010 rem *** joystick ***
  198. 3020 :
  199. 3030 j=peek(56320)
  200. 3040 if (j and 16)<>0 then 3120
  201. 3050 dr=dr+1000
  202. 3060 if dr>=10000 then dr=10000
  203. 3070 if (j and 1)=0 and jf=0 then jf=1:goto 3140
  204. 3080 if (j and 1)=0 and jf=1 then jf=0:ga=ga+1:if ga>5 then ga=5
  205. 3090 if (j and 2)=0 and jf=0 then jf=2:goto 3140
  206. 3100 if (j and 2)=0 and jf=2 then jf=0:ga=ga-1:if ga<0 then ga=0
  207. 3110 goto 3140
  208. 3120 dr=dr-1000
  209. 3130 if dr<0 then dr=0
  210. 3140 sp=dr/210*ga:vr=vr+int(dr/666):va=va+1
  211. 3150 if sp=0 then 3030
  212. 3160 return
  213. 4000 :
  214. 4010 rem *** message ausgeben ***
  215. 4020 :
  216. 4030 sys code,3
  217. 4040 if mn=0 then gosub 4100
  218. 4041 if mn=1 then gosub 4200
  219. 4042 if mn=2 then gosub 4300
  220. 4043 if mn=3 then gosub 4400
  221. 4044 if mn=4 then gosub 4500
  222. 4045 if mn=5 then gosub 4600
  223. 4046 if mn=6 then gosub 4700
  224. 4047 if mn=7 then gosub 4800
  225. 4048 if mn=8 then gosub 4900
  226. 4050 sys code,6,5
  227. 4055 for w=0 to 400
  228. 4060 if (peek(56320)and16)<>0 then next
  229. 4070 for i=1024+23*40 to 1024+25*40-1:poke i,96:next i:sys code,6,5:return
  230. 4100 print "beliefern[160]sie[160]ihre[160]kunden![160]legen[160]sie"
  231. 4110 print "bitte[160]eine[160]entsprechende[160]strecke[160]fest..";
  232. 4120 return
  233. 4200 print "beliefern[160]sie[160]ihre[160]kunden![160]fahren[160]sie"
  234. 4210 print "m*glichst[160]energiesparend...";
  235. 4220 return
  236. 4300 print "sie[160]haben[160]leider[160]nicht[160]gen^gend"
  237. 4310 print "treibstoff,[160]um[160]diese[160]strecke[160]zu[160]fahren!";
  238. 4320 return
  239. 4400 print "die[160]bestellungen[160]sind[160]kalt[160]geworden!"
  240. 4410 print "sie[160]m^ssen[160]sie[160]wieder[160]mitnehmen!";
  241. 4420 return
  242. 4500 print "sehr[160]gut![160]sie[160]sind[160]besonders[160]energie-"
  243. 4510 print "sparend[160]gefahren!...weiter";
  244. 4520 return
  245. 4600 print "durch[160]ihren[160]fahrstil[160]schonen[160]sie[160]die"
  246. 4610 print "umwelt[160]und[160]sparen[160]gleichzeitig[160]geld!";
  247. 4620 return
  248. 4700 print "sie[160]sollten[160]ihre[160]fahrweise[160]^berdenken!"
  249. 4710 print "aufgrund[160]ihres...weiter";
  250. 4720 return
  251. 4800 print "aggressiven[160]fahrstils[160]belasten[160]sie[160]die"
  252. 4810 print "umwelt[160]durch[160]erh*hten[160]energieverbrauch!";
  253. 4820 return
  254. 4900 print "sie[160]sollten[160]ihre[160]route[160]so[160]w@hlen,[160]da\"
  255. 4910 print "sie[160]ihre[160]kunden[160]beliefern[160]k*nnen!";
  256. 4920 return
  257. 5000 :
  258. 5010 rem *** display refreshen ***
  259. 5020 :
  260. 5025 if sp<80 then tt=tt+1
  261. 5026 if tt<20 then 5030
  262. 5027 mn=3:gosub 4000:goto 1
  263. 5030 x$=mid$(km$,int(sp/19)*4+1,4)
  264. 5040 kx=val(left$(x$,2))
  265. 5050 ky=val(right$(x$,2))
  266. 5060 x$=mid$(dr$,int(dr/1000)*4+1,4)
  267. 5070 rx=val(left$(x$,2))
  268. 5080 ry=val(right$(x$,2))
  269. 5090 sys code,23,kx,ky+10,2,18,4,5
  270. 5100 sys code,23,rx,ry+10,27,18,4,5
  271. 5101 for i=1 to 15
  272. 5102 if int(dr/666)>=i then poke 56104+i,7:goto 5104
  273. 5103 poke 56104+i,0
  274. 5104 next i
  275. 5110 if ga=0 then poke 53254,33:poke 53255,203:return
  276. 5120 if ga=1 then poke 53254,20:poke 53255,196:return
  277. 5130 if ga=2 then poke 53254,20:poke 53255,212:return
  278. 5140 if ga=3 then poke 53254,31:poke 53255,196:return
  279. 5150 if ga=4 then poke 53254,31:poke 53255,212:return
  280. 5160 if ga=5 then poke 53254,42:poke 53255,196:return
  281. 5170 return
  282.