home *** CD-ROM | disk | FTP | other *** search
/ Commodore Disk User Volume 1 #3 / Commodore_Disk_User_Vol.1_3_1988_-.d64 / maze (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  3KB  |  127 lines

  1. 100 print"[147]         *** micro-maze ***"
  2. 110 print"in this game,you have to make your way"
  3. 120 print"through a maze,but the screen will show"
  4. 130 print"the view from inside the maze,instead of";
  5. 140 print"from above it. you can turn left,right,"
  6. 150 print"go straight on or backwards at each"
  7. 160 print"junction,by typing l,r,f(forwards) or b.";
  8. 170 print"if you want to see the maze from above"
  9. 180 print"type 'h',but each time you do this your"
  10. 190 print"score will lessen."
  11. 200 print"       press any key to start"
  12. 210 geta$:ifa$=""then210
  13. 215 poke53280,0
  14. 220 print"[147]":poke53281,0:dima(8,8),c$(15),d(4),e(4),t(3),l(15),r(15)
  15. 225 a=0:b=0:c=0
  16. 230 forx=1to8:fory=1to8:reada(x,y):next:next
  17. 240 forx=0to15:readr(x),l(x):next
  18. 250 forx=1to4:readd(x),e(x):next
  19. 260 forx=0to15:fory=1to3:readc$:c$(x)=c$(x)+c$:ify<3thenc$(x)=c$(x)+"[157][157][157]"
  20. 270 next:next
  21. 300 h=0:n=0:px=1:py=1:rx=8:ry=8:d=1
  22. 310 gosub2000:gosub4000
  23. 320 ifpx<>rxorpy<>rythenn=n+1:goto310
  24. 330 print"[147]amaze[146]ing!":print"you've done it!"
  25. 340 print"your score is";
  26. 344 s=50-h*2-n
  27. 345 print-(s>0)*s;"out of 25."
  28. 350 end
  29. 1000 a=1073:b=1913:c=21:gosub9000
  30. 1010 a=1278:b=1718:c=11:gosub9000
  31. 1020 ife>1thena=1401:b=1601:c=5:gosub9000
  32. 1030 ife>2thena=1442:b=1562:c=3:gosub9000
  33. 1040 return
  34. 2000 print"[147]"
  35. 2010 gosub5000:gosub1000
  36. 2020 forx=1toe:i=t(x):j=iand1:k=iand2:l=iand4
  37. 2030 ifjthengosub2200
  38. 2040 ifkthengosub2100
  39. 2050 iflthengosub2300
  40. 2060 ifj=0thengosub2400
  41. 2070 ifl=0thengosub2500
  42. 2080 nextx
  43. 2090 return
  44. 2100 onxgoto2110,2120,2130
  45. 2110 a=1239:b=1248:c=520:goto6000
  46. 2120 a=1362:b=1365:c=280:goto6000
  47. 2130 a=1403:b=1404:c=200:goto6000
  48. 2200 onxgoto2210,2220,2230
  49. 2210 a=1074:b=1238:gosub7000:a=1758:b=1914:goto8000
  50. 2220 a=1279:b=1361:gosub7000:a=1641:b=1719:goto8000
  51. 2230 poke1402,77:poke1602,78:return
  52. 2300 onxgoto2310,2320,2330
  53. 2310 a=1093:b=1249:gosub8000:a=1769:b=1933:goto7000
  54. 2320 a=1288:b=1366:gosub8000:a=1646:b=1728:goto7000
  55. 2330 poke1405,78:poke1605,77:return
  56. 2400 onxgoto2410,2420,2430
  57. 2410 a=1234:b=1238:c=520:goto6000
  58. 2420 a=1359:b=1361:c=280:goto6000
  59. 2430 poke1402,100:poke1602,99:return
  60. 2500 onxgoto2510,2520,2530
  61. 2510 a=1249:b=1253:c=520:goto6000
  62. 2520 a=1366:b=1368:c=280:goto6000
  63. 2530 poke1405,100:poke1605,99:return
  64. 3000 forx=1to8:fory=1to8:q=a(x,y)
  65. 3010 printc$(q)"[145][145]";
  66. 3020 next:print"":next:h=h+1
  67. 3030 poke1065+(py-1)*3+(px-1)*120,42
  68. 3040 poke1065+(ry-1)*3+(rx-1)*120,134
  69. 3050 geta$:ifa$=""then3050
  70. 3060 print"[147]":return
  71. 4000 print"type your move:"
  72. 4010 geta$:ifa$=""then4010
  73. 4020 ifa$="h"thenprint"[147]";:gosub3000:gosub2010:goto4000
  74. 4030 ifa$="f"and(t(1)and2)=0then4080
  75. 4040 ifa$="b"and(t(1)and8)=0then4110
  76. 4050 ifa$="l"and(t(1)and1)=0then4130
  77. 4060 ifa$="r"and(t(1)and4)=0then4150
  78. 4065 ifa$=""thenprint"[147]":end
  79. 4070 goto4010
  80. 4080 pm=px:pn=py:px=px+d(d):py=py+e(d)
  81. 4090 ifpx<1orpx>8orpy<1orpy>8thenpx=pm:py=pn:goto4010
  82. 4100 return
  83. 4110 d=d+2:ifd>4thend=d-4
  84. 4120 goto4080
  85. 4130 d=d-1:ifd=0thend=4
  86. 4140 goto4080
  87. 4150 d=d+1:ifd=5thend=1
  88. 4160 goto4080
  89. 5000 x=px:y=py:t(1)=a(x,y):e=1
  90. 5010 e=e+1:x=x+d(d):y=y+e(d):ifx<1orx>8ory<1ory>8thene=e-1:goto5040
  91. 5020 e=e+1:t(2)=a(x,y):x=x+d(d):y=y+e(d):ifx<1orx>8ory<1ory>8thene=e-1:goto5040
  92. 5030 t(3)=a(x,y)
  93. 5040 forx=1toe
  94. 5050 ifd<3thent(x)=r(t(x))
  95. 5060 ifd=3thent(x)=l(t(x))
  96. 5070 ifd=2thent(x)=r(t(x))
  97. 5080 next:forx=1toe
  98. 5090 if(t(x)and2)>0thene=x:return
  99. 5100 next:return
  100. 6000 fory=atob:pokey,100:pokey+c,99:next:return
  101. 7000 fory=atobstep41:pokey,77:next:return
  102. 8000 fory=atobstep39:pokey,78:next:return
  103. 9000 fory=atobstep40:pokey,103:pokey+c,101:next:return
  104. 9500 data11,2,6,3,10,14,7,7,3,4,1,0,2,10,8,4
  105. 9510 data5,13,5,13,1,14,11,12,9,6,9,14,9,6,3,14
  106. 9520 data3,4,3,6,3,8,8,6,9,12,5,9,8,10,10,12
  107. 9530 data3,2,12,3,2,10,2,6,13,9,10,12,9,14,13,13
  108. 9540 data0,0,8,2,1,4,9,6,2,8,10,10,3,12,11,14,4,1,12,3,5,5
  109. 9550 data13,7,6,9,14,11,7,13,15,15
  110. 9560 data0,1,1,0,0,-1,-1,0
  111. 9570 data"[166] [166]","   ","[166] [166]"
  112. 9580 data"[166] [166]","[166]  ","[166] [166]"
  113. 9590 data"[166][166][166]","   ","[166] [166]"
  114. 9600 data"[166][166][166]","[166]  ","[166] [166]"
  115. 9610 data"[166] [166]","  [166]","[166] [166]"
  116. 9620 data"[166] [166]","[166] [166]","[166] [166]"
  117. 9630 data"[166][166][166]","  [166]","[166] [166]"
  118. 9640 data"[166][166][166]","[166] [166]","[166] [166]"
  119. 9650 data"[166] [166]","   ","[166][166][166]"
  120. 9660 data"[166] [166]","[166]  ","[166][166][166]"
  121. 9670 data"[166][166][166]","   ","[166][166][166]"
  122. 9680 data"[166][166][166]","[166]  ","[166][166][166]"
  123. 9690 data"[166] [166]","  [166]","[166][166][166]"
  124. 9700 data"[166] [166]","[166] [166]","[166][166][166]"
  125. 9710 data"[166][166][166]","  [166]","[166][166][166]"
  126. 9720 data"[166][166][166]","[166] [166]","[166][166][166]"
  127.