home *** CD-ROM | disk | FTP | other *** search
/ Software Du Jour / SoftwareDuJour.iso / HOME / GAMES / SURVIVAL.BAS (.txt) < prev    next >
Encoding:
GW-BASIC  |  1988-03-01  |  18.9 KB  |  621 lines

  1. 10  '---------------------------------------------------------------
  2. 12  '
  3. 14  ' Survival: by Stewart F. Rush (Enhancements by G. M. Bright)
  4. 16  '
  5. 18  ' variable definitions: P  = current position
  6. 20  '                       T1 = current elapsed time
  7. 22  '                       T2 = oxygen remaining
  8. 24  '                       C  = no. of items carried
  9. 28  '                       F1 = flag: shed open
  10. 30  '                       F2 = flag: meteor shower occurred
  11. 32  '                       F3 = flag: laser beam deflected
  12. 34  '                       F4 = flag: ventillator shaft illuminated
  13. 36  '                       F5 = flag: deactivator exposed
  14. 38  '                       F7 = flag: spacecraft repair status
  15. 40  '                       F9 = flag: power in use
  16. 42  '                       P1 = power unit power remaining
  17. 44  '                       P2 = power pack power remaining
  18. 45  '                       V  = number of reads of computer message
  19. 46  '
  20. 60  '---------------------------------------------------------------
  21. 100  SCREEN 0: WIDTH 80
  22. 170  CLEAR: DIM T$(64): DIM M(43,8): DIM O(15)
  23. 176  '***************************************
  24. 178  '** initialize text and move matrices **
  25. 180  '***************************************
  26. 182  CLS: COLOR 16,7: PRINT "SURVIVAL";: COLOR 7,0
  27. 184  DEF SEG=0:X=PEEK(&H417) AND &H40:IF X=64 THEN POKE &H417,PEEK(&H417) AND &H0:'   toggle lowercase
  28. 186  PRINT ": Would you like instructions (y/n)?"
  29. 220  D$=INKEY$:IF D$="" THEN 220 ELSE IF D$="y" THEN GOSUB 5040
  30. 221  PRINT: PRINT "initialization in process - please wait"
  31. 222  FOR I=1 TO 15
  32. 224    READ O(I)
  33. 226  NEXT I
  34. 230  FOR I= 1 TO 64
  35. 240    READ T$(I)
  36. 250  NEXT I
  37. 260  FOR I= 1 TO 43
  38. 270    FOR J = 1 TO 8
  39. 280      READ M(I,J)
  40. 290    NEXT J
  41. 300  NEXT I
  42. 305  RESTORE
  43. 320  P=1: C=2: T1=0: T2=185: P1=230: P2=50: V=0
  44. 390  F1=0: F2=0: F3=0: F4=0: F5=0: F7=0: F9=0
  45. 400  M(2,8)=6
  46. 410  M(14,8)=30
  47. 620  REM *****************************************************
  48. 630  REM ** display current status and location information **
  49. 640  REM *****************************************************
  50. 650  CLS
  51. 653  COLOR 0,7:PRINT "*****************************************":COLOR 7,0
  52. 654  COLOR 0,7:PRINT "* CURRENT STATUS & LOCATION INFORMATION *":COLOR 7,0
  53. 655  COLOR 0,7:PRINT "*****************************************":COLOR 7,0
  54. 690  IF O(11)=99 AND P1>0 THEN P1=P1-5
  55. 700  IF O(14)=99 AND P2>0 THEN P2=P2-5
  56. 710  IF O(3)=99 AND T2>0 THEN T2=T2-5
  57. 720  IF (P>21) AND (F9=0) THEN 760
  58. 730  IF (O(11)<>99) AND (O(14)<>99) THEN 2870
  59. 740  IF (O(11)=99) AND (P1=0) THEN 2870
  60. 750  IF (O(14)=99) AND (P2=0) THEN 2870
  61. 760  IF (P>17) AND (P<22) THEN 790
  62. 770  IF (P>21) AND (P<>38) AND (F9=0) THEN 790
  63. 775  IF (P=38) AND (R=39) AND (F9=0) THEN 790
  64. 780  IF (O(3)<>99) OR (T2=0) THEN 2900
  65. 790  PRINT: PRINT "ELAPSED TIME: ";T1;" MINUTES"
  66. 800  IF O(11)=99 THEN PRINT "POWER UNIT: ";P1;" UNITS"
  67. 810  IF O(14)=99 THEN PRINT "POWER PACK: ";P2;" UNITS"
  68. 820  IF O(3)=99 THEN PRINT "OXYGEN REMAINING: ";T2;" MINUTES"
  69. 830  IF T1>400 THEN 2960
  70. 840  IF T1>350 THEN 3840
  71. 850  IF T1>200 THEN 3740
  72. 855  T1=T1+5
  73. 860  PRINT: PRINT "LOCATION: You are ";
  74. 870  FOR I=M(P,7) TO M(P,8)
  75. 880  PRINT T$(I)
  76. 890  NEXT I
  77. 900  PRINT "##"
  78. 910  REM *********************************
  79. 920  REM ** display any objects present **
  80. 930  REM *********************************
  81. 940  IF P=14 THEN 1920
  82. 950  FOR I = 1 TO 15
  83. 960  IF O(I)<>P THEN 990
  84. 970  GOSUB 4410
  85. 980  PRINT "There is ";B$;" here."
  86. 990  NEXT I
  87. 1000  GOTO 2000
  88. 1010  REM ****************************************
  89. 1020  REM ** read and process keyboard response **
  90. 1030  REM ****************************************
  91. 1040  INPUT B$: IF LEN(B$)<>1 GOTO 1320
  92. 1050  I=INSTR(1,"nsewudq",B$)
  93. 1060  IF I=0 GOTO 1570 ELSE IF I=7 GOTO 9999
  94. 1150  IF M(P,I)=0 THEN PRINT "You cannot go in that direction!": GOTO 1040
  95. 1160  IF M(P,I)=99 THEN 2940
  96. 1170  Q=M(P,I)
  97. 1180  IF P=12 THEN 3060
  98. 1190  IF P=13 THEN 3180
  99. 1200  IF P=22 THEN 3310
  100. 1210  IF P=23 THEN 3420
  101. 1220  IF P=29 THEN 3470
  102. 1230  R=P
  103. 1240  P=Q
  104. 1260  GOTO 650
  105. 1290  REM ********************************************
  106. 1300  REM ** process two or more character commands **
  107. 1310  REM ********************************************
  108. 1320  C$=LEFT$(B$,3)
  109. 1330  IF C$="loo" THEN 650
  110. 1340  IF C$="des" THEN 650
  111. 1345  IF C$="sta" THEN 650
  112. 1350  IF C$="get" THEN 2190
  113. 1360  IF C$="tak" THEN 2190
  114. 1370  IF C$="kee" THEN 2190
  115. 1380  IF C$="dro" THEN 2580
  116. 1390  IF C$="lea" THEN 2580
  117. 1400  IF C$="put" THEN 2580
  118. 1410  IF C$="inv" THEN 2780
  119. 1420  IF C$="qui" THEN 9999
  120. 1430  IF C$="end" THEN 9999
  121. 1440  IF C$="tra" THEN 1750
  122. 1450  IF C$="dig" THEN 1860
  123. 1470  IF C$="fue" THEN 4030
  124. 1480  IF C$="rea" THEN 4250
  125. 1490  IF C$="dea" THEN 3890
  126. 1500  IF C$="bla" THEN 4110
  127. 1505  IF C$="fir" THEN 4110
  128. 1510  IF C$="up" THEN 1640
  129. 1520  IF C$="dow" THEN 1640
  130. 1530  IF C$="nor" THEN 1640
  131. 1540  IF C$="sou" THEN 1640
  132. 1550  IF C$="eas" THEN 1640
  133. 1560  IF C$="wes" THEN 1640
  134. 1562  IF C$="hel" THEN 1581
  135. 1564  IF C$="wha" THEN 1581
  136. 1566  IF C$="deb" THEN 1610
  137. 1567  IF C$="ent" THEN 1670
  138. 1570  PRINT "Invalid Command"
  139. 1575  IF IC<5 THEN PRINT "You may enter `help' for some suggestions."
  140. 1580  GOTO 1040
  141. 1581  PRINT "Valid direction commands are: North, South, East, West, Up & Down."
  142. 1582  PRINT "You can also just enter the first letter, i.e. n,s,w,e,u,d."
  143. 1583  PRINT "Other commands include: INVentory, FUEL, DIG, TRAnsport, etc."
  144. 1584  PRINT "The latter can be abbreviated by using only 3 letters. The"
  145. 1585  PRINT "commands TRY or USE are useful only when you confront a situation."
  146. 1586  PRINT "Commands other than directives may require an object. Good luck!"
  147. 1587  GOTO 1040
  148. 1590  PRINT "I cannot process your request!"
  149. 1600  GOTO 1040
  150. 1610  PRINT "enter location"
  151. 1620  INPUT P
  152. 1630  GOTO 650
  153. 1640  D$=LEFT$(B$,1)
  154. 1650  B$=D$
  155. 1660  GOTO 1050
  156. 1670  '
  157. 1672  ' PROCESS SHED AND SPACE CRAFT ENTRY
  158. 1674  '
  159. 1680  IF P<>13 AND P<>15 THEN 1590
  160. 1690  IF P=13 THEN I=4: GOTO 3180
  161. 1700  I=2: GOTO 1170
  162. 1720  REM *******************************
  163. 1730  REM ** process transport command **
  164. 1740  REM *******************************
  165. 1750  IF P<>36 THEN 1800
  166. 1760  IF O(8)=99 THEN 1590
  167. 1770  P=O(8)
  168. 1780  PRINT "Beaming in process "
  169. 1782  FOR I = 1 TO 60: PRINT "~";: SOUND 300,1: NEXT
  170. 1790  GOTO 650
  171. 1800  IF P<>O(8) THEN 1590 ELSE P=36: GOTO 1780
  172. 1830  REM *************************
  173. 1840  REM ** process dig command **
  174. 1850  REM *************************
  175. 1860  IF O(15)<>99 THEN GOTO 3940
  176. 1865  IF P<>10 THEN PRINT "The ground is too hard here.": GOTO 1040
  177. 1870  O(9)=10
  178. 1880  GOTO 940
  179. 1890  REM *************************************
  180. 1900  REM ** drop illuminator if at overlook **
  181. 1910  REM *************************************
  182. 1920  IF O(4)<>99 THEN 950
  183. 1930  O(4)=100
  184. 1940  PRINT "You dropped your illuminator!!!  You cannot retrieve it."
  185. 1950  GOTO 950
  186. 1970  REM *******************
  187. 1980  REM ** process robot **
  188. 1990  REM *******************
  189. 2000  IF O(5)=28 THEN O(5)=35
  190. 2010  IF O(5)=42 THEN O(5)=28
  191. 2020  IF O(5)=41 THEN O(5)=42
  192. 2030  IF O(5)=27 THEN O(5)=41
  193. 2040  IF O(5)=25 THEN O(5)=27
  194. 2050  IF O(5)<>35 THEN 2090
  195. 2060  IF P<>28 THEN 1010
  196. 2070  M(28,1)=35
  197. 2080  GOTO 1010
  198. 2090  IF O(5)<>32 THEN 1010
  199. 2100  IF P<>32 THEN 1010
  200. 2110  O(5)=25
  201. 2120  IF O(13)=99 THEN 1010
  202. 2130  PRINT "Robot fails to recognize you.  It fires a phasor weapon at you!!!"
  203. 2135  FOR I=1 TO 1800:  NEXT
  204. 2140  FOR I=1 TO 3: FOR IS=1 TO 12: IT=(25*IS): SOUND 2600-IT,1: NEXT: NEXT
  205. 2145  FOR I=1 TO 1800:  NEXT
  206. 2150  GOTO 2980
  207. 2160  REM *********************************
  208. 2170  REM ** process get or take command **
  209. 2180  REM *********************************
  210. 2190  GOSUB 4590
  211. 2200  IF I>0 THEN 2260
  212. 2210  IF I<0 THEN 2240
  213. 2220  PRINT "I don't recognize ";RIGHT$(B$,LEN(B$)-J);"."
  214. 2230  GOTO 1040
  215. 2240  PRINT "What item?"
  216. 2250  GOTO 1040
  217. 2260  IF O(I)<>P THEN 2370
  218. 2270  IF C>3 THEN PRINT "You can't carry anymore!": GOTO 1040
  219. 2280  IF I=5 THEN PRINT "You can't carry a Robot!": GOTO 1040
  220. 2285  IF I=7 THEN PRINT "The bomb is way too heavy!": GOTO 1040
  221. 2290  IF I=10 THEN 2430
  222. 2300  IF I=11 THEN 2460
  223. 2310  IF I=14 THEN 2490
  224. 2320  C=C+1
  225. 2330  O(I)=99
  226. 2340  IF I=3 THEN F0=1
  227. 2350  PRINT "Okay"
  228. 2360  GOTO 1040
  229. 2370  IF O(I)=99 THEN 2542
  230. 2375  PRINT "There is no ";RIGHT$(B$,LEN(B$)-J);" here!!!"
  231. 2380  GOTO 1040
  232. 2430  PRINT "You can't get the message.  It's on the terminal screen."
  233. 2450  GOTO 1040
  234. 2460  IF O(14)=99 THEN 2520
  235. 2470  O(11)=99
  236. 2480  GOTO 2320
  237. 2490  IF O(11)=99 THEN 2520
  238. 2500  O(14)=99
  239. 2510  GOTO 2320
  240. 2520  PRINT "You can't have more than one power device at a time!"
  241. 2540  GOTO 1040
  242. 2542  PRINT "You already have ";RIGHT$(B$,LEN(B$)-J);"!"
  243. 2544  GOTO 1040
  244. 2550  REM ***********************************
  245. 2560  REM ** process drop or leave command **
  246. 2570  REM ***********************************
  247. 2580  GOSUB 4590
  248. 2590  IF I>0 THEN 2620
  249. 2600  IF I<0 THEN 2240
  250. 2610  GOTO 2220
  251. 2620  IF O(I)<>99 THEN 2690
  252. 2630  C=C-1
  253. 2640  O(I)=P
  254. 2680  GOTO 2350
  255. 2690  PRINT "You don't have "RIGHT$(B$,LEN(B$)-J);"!"
  256. 2700  GOTO 1040
  257. 2750  REM *******************************
  258. 2760  REM ** process inventory command **
  259. 2770  REM *******************************
  260. 2780  FOR I=1 TO 15
  261. 2790  IF O(I)<>99 THEN 2820
  262. 2800  GOSUB 4410
  263. 2810  PRINT "You have ";B$;"."
  264. 2820  NEXT I
  265. 2830  GOTO 1040
  266. 2840  REM ************************************
  267. 2850  REM ** program termination processing **
  268. 2860  REM ************************************
  269. 2870  PRINT "You have no power left, or you have no power source."
  270. 2880  PRINT "You have frozen to death."
  271. 2890  GOTO 2980
  272. 2900  PRINT "Oxygen required here, none available."
  273. 2910  GOTO 2980
  274. 2920  PRINT "A nuclear detonation has just occurred."
  275. 2930  GOTO 2980
  276. 2940  PRINT "You have fallen to your death."
  277. 2950  GOTO 2980
  278. 2952  PRINT "You have been zapped by the laser."
  279. 2954  GOTO 2980
  280. 2960  PRINT "The moon base has just been destroyed by a large asteroid."
  281. 2980  PRINT "You have failed to survive."
  282. 2990  INPUT "Do you wish to try again";D$
  283. 3010  IF LEFT$(D$,1)="y" THEN 221
  284. 3020  GOTO 9999
  285. 3030  REM ***************************
  286. 3040  REM ** process meteor shower **
  287. 3050  REM ***************************
  288. 3060  IF M(P,I)<>13 THEN 1230
  289. 3070  IF F2=1 THEN 1230
  290. 3080  PRINT "There is a meteor shower.  Your space suit has developed a leak!!"
  291. 3100  GOSUB 4890
  292. 3110  IF I<>2 THEN 2980
  293. 3120  PRINT "Proceeding to seal suit.......":FOR CX=1 TO 1500: NEXT CX
  294. 3130  F2=1
  295. 3140  GOTO 1230
  296. 3150  REM *************************
  297. 3160  REM ** process locked shed **
  298. 3170  REM *************************
  299. 3180  IF M(P,I)<>22 THEN 1230
  300. 3190  IF F1=1 THEN 1230
  301. 3200  PRINT "The shed is locked"
  302. 3210  GOSUB 4890
  303. 3220  IF I<>1 THEN 3260
  304. 3230  PRINT "Proceeding to try key.......":FOR CX=1 TO 1500: NEXT CX
  305. 3240  F1=1
  306. 3250  GOTO 1230
  307. 3260  PRINT "Your attempt fails."
  308. 3270  GOTO 1040
  309. 3280  REM ***********************************
  310. 3290  REM ** process dark ventilator shaft **
  311. 3300  REM ***********************************
  312. 3310  IF M(P,I)<>23 THEN 1230
  313. 3320  IF F4=1 THEN 1230
  314. 3330  PRINT "It is dangerous to proceed in the dark!"
  315. 3340  GOSUB 4890
  316. 3350  IF I<>4 THEN 2940
  317. 3360  PRINT "The shaft is now illuminated.  You may proceed.......":FOR CX=1 TO 2500: NEXT CX
  318. 3370  F4=1
  319. 3380  GOTO 1230
  320. 3390  REM ************************************
  321. 3400  REM ** process shaft with no illuminator
  322. 3410  REM ***************************************
  323. 3420  IF O(4)<>99 THEN IF O(4)<>23 THEN 2940
  324. 3430  GOTO 1230
  325. 3440  REM ************************
  326. 3450  REM ** process laser beam **
  327. 3460  REM ************************
  328. 3470  IF M(P,I)<>37 THEN 1230
  329. 3480  IF F3=1 THEN 1230
  330. 3490  PRINT "There is a laser beam here. Passage not possible with beam present."
  331. 3510  GOSUB 4890
  332. 3520  IF I<>12 THEN 2952
  333. 3530  PRINT "Proceeding to deflect beam.......":FOR CX=1 TO 2500: NEXT CX
  334. 3540  F3=1
  335. 3550  GOTO 1230
  336. 3560  REM *****************************************
  337. 3570  REM ** process blown seal in space station **
  338. 3580  REM *****************************************
  339. 3590  IF R<>29 THEN 850
  340. 3600  IF F9=1 THEN 850
  341. 3610  F9=1
  342. 3620  PRINT "You have just blown the air seal in space station."
  343. 3640  GOTO 850
  344. 3710  REM ************************
  345. 3720  REM ** expose deactivator **
  346. 3730  REM ************************
  347. 3740  IF F5=1 THEN 855
  348. 3750  O(6)=14
  349. 3760  M(2,8)=5
  350. 3770  M(14,8)=29
  351. 3780  M(14,4)=2
  352. 3790  F5=1
  353. 3800  GOTO 855
  354. 3810  REM *******************
  355. 3820  REM ** detonate bomb **
  356. 3830  REM *******************
  357. 3840  IF F7=0 THEN 2920
  358. 3850  GOTO 850
  359. 3860  REM *********************
  360. 3870  REM ** deactivate bomb **
  361. 3880  REM *********************
  362. 3890  IF O(6)<>99 THEN 3940
  363. 3900  IF P<>38 THEN 3980
  364. 3910  F7=1
  365. 3915  T$(31)="at crash site of a space craft.  Repairs are now complete."
  366. 3920  PRINT "Bomb is now deactivated."
  367. 3930  GOTO 1040
  368. 3940  PRINT "You have nothing to do it with!"
  369. 3950  GOTO 1040
  370. 3960  PRINT "There is nothing to do it to!"
  371. 3970  GOTO 1040
  372. 3980  PRINT "You can't do it from here!"
  373. 3990  GOTO 1040
  374. 4000  REM *****************
  375. 4010  REM ** fuel rocket **
  376. 4020  REM *****************
  377. 4030  IF P<>19 THEN 3980
  378. 4040  IF O(9)<>99 THEN 3940
  379. 4050  O(9)=98
  380. 4060  PRINT "Fuel is now loaded."
  381. 4070  GOTO 1040
  382. 4080  REM *************************
  383. 4090  REM ** blastoff processing **
  384. 4100  REM *************************
  385. 4110  IF P<>21 THEN 3980
  386. 4120  IF O(9)<>98 THEN 4200
  387. 4130  IF F7=1 THEN 4160
  388. 4140  PRINT "Repairs not yet complete."
  389. 4150  GOTO 1040
  390. 4160  FOR IS=1 TO 150: IJ=IS*10: SOUND IJ+1000,1: NEXT IS
  391. 4165  PRINT "Congratulations, you have just blasted off and are on your way to               earth.  Your escape time was ";T1;" minutes."
  392. 4190  GOTO 2990
  393. 4200  PRINT "Your space craft has no fuel!!"
  394. 4210  GOTO 1040
  395. 4220  REM *********************************
  396. 4230  REM ** computer readout processing **
  397. 4240  REM *********************************
  398. 4250  IF P<>35 THEN 3980
  399. 4260  GOSUB 4590
  400. 4270  IF I<>10 THEN 3960
  401. 4280  IF V<>0 THEN 4320
  402. 4290  PRINT "Bomb de-activator located somewhere east of Mare Serenitatis on moon's surface."
  403. 4310  GOTO 4360
  404. 4320  IF V<>1 THEN 4350
  405. 4330  PRINT "Local fuel source: Dilithium Crystal."
  406. 4340  GOTO 4360
  407. 4350  PRINT "Dilithium found in soft surfaces."
  408. 4360  IF F7=1 THEN PRINT "Spacecraft repairs complete."
  409. 4365  V=V+1
  410. 4370  GOTO 1040
  411. 4380  REM **********************************************
  412. 4390  REM ** subroutine to describe items at location **
  413. 4400  REM **********************************************
  414. 4410  IF I=1 THEN B$="an ELECTRONIC KEY"
  415. 4420  IF I=2 THEN B$="SEALANT"
  416. 4430  IF I=3 THEN B$="an OXYGEN MODULE"
  417. 4440  IF I=4 THEN B$="an ILLUMINATOR"
  418. 4450  IF I=5 THEN B$="a ROBOT"
  419. 4460  IF I=6 THEN B$="a DEACTIVATOR"
  420. 4470  IF I=7 THEN B$="a NUCLEAR BOMB"
  421. 4480  IF I=8 THEN B$="a TRANSPORTER UNIT"
  422. 4490  IF I=9 THEN B$="DILITHIUM CRYSTALS"
  423. 4500  IF I=10 THEN B$="a COMPUTER MESSAGE"
  424. 4510  IF I=11 THEN B$="a POWER UNIT"
  425. 4520  IF I=12 THEN B$="a MIRROR"
  426. 4530  IF I=13 THEN B$="a CODED BADGE"
  427. 4540  IF I=14 THEN B$="a POWER PACK"
  428. 4545  IF I=15 THEN B$="a SHOVEL"
  429. 4550  RETURN
  430. 4560  REM ***********************************************
  431. 4570  REM ** subroutine to convert an item to a number **
  432. 4580  REM ***********************************************
  433. 4590  FOR J=1 TO LEN(B$)
  434. 4600  IF MID$(B$,J,1)=" " THEN 4640
  435. 4610  NEXT J
  436. 4620  I=-1
  437. 4630  RETURN
  438. 4640  C$=MID$(B$,J+1,3)
  439. 4650  I=0
  440. 4660  IF C$="ele" THEN I=1
  441. 4670  IF C$="key" THEN I=1
  442. 4680  IF C$="sea" THEN I=2
  443. 4690  IF C$="oxy" THEN I=3
  444. 4700  IF C$="mod" THEN I=3
  445. 4710  IF C$="ill" THEN I=4
  446. 4720  IF C$="rob" THEN I=5
  447. 4730  IF C$="dea" THEN I=6
  448. 4740  IF C$="nuc" THEN I=7
  449. 4750  IF C$="bom" THEN I=7
  450. 4760  IF C$="tra" THEN I=8
  451. 4770  IF C$="dil" THEN I=9
  452. 4780  IF C$="cry" THEN I=9
  453. 4790  IF C$="com" THEN I=10
  454. 4800  IF C$="mes" THEN I=10
  455. 4810  IF C$="uni" THEN I=11
  456. 4820  IF C$="mir" THEN I=12
  457. 4830  IF C$="bad" THEN I=13
  458. 4840  IF C$="pac" THEN I=14
  459. 4845  IF C$="sho" THEN I=15
  460. 4850  RETURN
  461. 4860  REM ***************************************
  462. 4870  REM ** subroutine to process try command **
  463. 4880  REM ***************************************
  464. 4890  INPUT B$
  465. 4900  C$=LEFT$(B$,3)
  466. 4910  IF C$="try" THEN 4950
  467. 4920  IF C$="use" THEN 4950
  468. 4930  I=-1
  469. 4940  RETURN
  470. 4950  GOSUB 4590
  471. 4960  IF I<1 THEN 5012
  472. 4970  IF O(I)=99 THEN RETURN
  473. 4980  PRINT"You don't have ";RIGHT$(B$,LEN(B$)-J);"!"
  474. 4990  GOTO 4930
  475. 5000  PRINT "Your attempt fails!"
  476. 5010  GOTO 4930
  477. 5012  PRINT "With what?": GOTO 4930
  478. 5020  REM ************************
  479. 5030  REM ** print instructions **
  480. 5040  REM ************************
  481. 5045  CLS
  482. 5050  PRINT "You have crash landed on the earth's moon.  You have limited supplies and time  in which to survive.  You will encounter various items and situations during    your travels."
  483. 5055  PRINT
  484. 5060  PRINT "To travel, you may enter directions such as north or n, as well as s, e, w, and u or d (up or down)."
  485. 5065  PRINT
  486. 5090  PRINT "To communicate, enter commands (verbs), followed by object names, if applicable.For example: get xxx, leave xxx, use xxx, etc."
  487. 5110  PRINT "Unless instructed otherwise, be sure to press the ENTER key after each input.   The enter key is on the right of the keyboard and has this symbol on it: "+CHR$( 17)+CHR$(196)+CHR$(217)
  488. 5115  PRINT
  489. 5120  PRINT "Once you have survived, the object then is to achieve the optimum survival time.May the force be with you!!!"
  490. 5122  PRINT
  491. 5124  COLOR 16,7:PRINT"Press any key to continue":COLOR 7,0
  492. 5126  A$=INKEY$: IF A$="" THEN 5126
  493. 5130  RETURN
  494. 6000  '****************************************
  495. 6001  '** object locations                   **
  496. 6002  '****************************************
  497. 6010  DATA 21,19,99,06,32,00,38
  498. 6020  DATA 35,00,35,99,33,34,37,43
  499. 7500  '********************************
  500. 7501  '** text location descriptions **
  501. 7502  '********************************
  502. 8001  DATA "at Mare Serenitatis. Long eerie"
  503. 8002  DATA "shadows from distant mountains and craters cast"
  504. 8003  DATA "themselves across the barren landscape."
  505. 8004  DATA "on a promontary point on the rim of the"
  506. 8005  DATA "crater Posidonius, only half visible when seen from below."
  507. 8006  DATA "There is total darkness to the East."
  508. 8007  DATA "between the craters of Dawes and Plinius."
  509. 8008  DATA "at a narrow pass in the mountains of Haemus."
  510. 8009  DATA "at a steep base of the crater of Manilus."
  511. 8010  DATA "at Mare Vaporum. The Apennines Mountains"
  512. 8011  DATA "rise ominously to the North and West."
  513. 8012  DATA "at the base of the awesome Mt. Eudoxus."
  514. 8013  DATA "inside the crater of Aristoteles. The"
  515. 8014  DATA "crater floor is littered with rocks."
  516. 8015  DATA "in Lacus Somnorium, North of Posidonius"
  517. 8016  DATA "and North East of Mare Serenitatus."
  518. 8017  DATA "at the base of the Burg crater in Lacus"
  519. 8018  DATA "Mortis. The surface is very soft here."
  520. 8019  DATA "at the East side of the vast Mare of"
  521. 8020  DATA "Imbrium. To the North the low angle of"
  522. 8021  DATA "the sun casts eerie shadows on the soft lunar surface"
  523. 8022  DATA "and the distant mountains to the East. To the West, the"
  524. 8023  DATA "Mare stretches out of sight to the horizon. To the South"
  525. 8024  DATA "the Apennine Mountains seem to rise out of nowhere."
  526. 8025  DATA "at the base of the crater of Plato. A"
  527. 8026  DATA "shiney object is seen to the West."
  528. 8027  DATA "standing before a small metal shed. A"
  529. 8028  DATA "sign reads ventillator shaft number 2."
  530. 8029  DATA "somewhere East of Mare Serenitatus."
  531. 8030  DATA "There is total darkness."
  532. 8031  DATA "at the crash site of a space craft."
  533. 8032  DATA "The entrance to the space craft is before you."
  534. 8033  DATA "at the center of vast Mare of Imbrium."
  535. 8034  DATA "in the air lock chamber of the space cINT100
  536. 8409     KINGDOM
  537. 110  '
  538. 120  GOSUB 2210:GOSUB 1990
  539. 130  KEY OFF:WIDTH 80
  540. 140  RANDOMIZE VAL(RIGHT$(TIME$,2))
  541. 150  CLS:RESTORE:K=100:S=500:P=2500:Q=100
  542. 160  A=0:D=1:M=0:N=0:Z1=0:L=5
  543. 170  GOSUB 1840
  544. 180  B1=0:B2=0:B3=0:B4=0:B5=0:K1=0:S1=0:P1=0:N1=0
  545. 190  ON M GOTO 330,440,540,690
  546. 200  IF S<=2*K OR S<T1 THEN M=M+1:GOTO 330
  547. 210  IF 5*K<=Q THEN M=M+1:GOTO 330
  548. 220  PRINT "HOW MANY SQUARES DO YOU WISH TO TRADE SERVANTS FOR";
  549. 230  GOSUB 2490:B1=AA
  550. 240  IF S-(B1*T1)=>2*K THEN 280
  551. 250  PRINT "SERVANTS MUST TEND YOUR KNIGHTS, ";
  552. 260  PRINT "YOU MAY TRADE FOR ONLY";INT((S-2*K)/T1);"SQUARES."
  553. 270  GOTO 220
  554. 280  IF Q+B1=<5*K THEN 310
  555. 290  PRINT "YOU HAVEN'T ENOUGH KNIGHTS TO PROTECT SUCH A KINGDOM!"
  556. 300  GOTO 220
  557. 310  S=S-B1*T1:Q=Q+B1
  558. 320  M=M+1:GOTO 170
  559. 330  IF P<=5*Q+T2 OR P<T2 THEN M=M+1:GOTO 440
  560. 340  IF 5*K<=Q THEN  M=M+1:GOTO 440
  561. 350  PRINT "HOW MANY SQUARES DO YOU WISH TO ACQUIRE BY TRADING PEASANTS FOR";
  562. 360  GOSUB 2490:B2=AA:IF P-(B2*T2)=>5*(Q+B2) THEN 400
  563. 370  GOSUB 1740
  564. 380  PRINT "PEASANTS MUST TEND YOUR LAND, ";
  565. 390  PRINT "YOU MAY TRADE FOR ONLY";Z;"SQUARES.":GOTO 350
  566. 400  IF Q+B2<=5*K THEN 430
  567. 410  PRINT "YOU HAVE NOT ENOUGH KNIGHTS TO PROTECT SUCH A KINGDOM!
  568. 420  GOTO 350
  569. 430  P=P-(B2*T2):Q=Q+B2:GOTO 320
  570. 440  IF D=1 OR N<T3 OR 5*K<=Q THEN M=M+1:GOTO 540
  571. 450  PRINT "HOW MANY SQUARES DO YOU WISH TO ACQUIRE BY TRADING NOMADS FOR";
  572. 460  GOSUB 2490:B5=AA:IF N-(B5*T3)>=0 THEN 500
  573. 470  PRINT "SIR, YOU HAVE NOT ENOUGH NOMADS TO MAKE SUCH A TRADE!"
  574. 480  X=INT(N/T3):IF Q+X>5*K THEN X=5*K-Q
  575. 490  PRINT "YOU MAY TRADE FOR ONLY";X;"SQUARES.":GOTO 450
  576. 500  IF Q+B5=<5*K THEN 530
  577. 510  PRINT "SIR, YOU HAVEN'T ENOUGH KNIGHTS TO PROTECT SUCH A KINGDOM"
  578. 520  GOTO 450
  579. 530  N=N-B5*T3:Q=Q+B5:GOTO 320
  580. 540  PRINT "HOW MANY SQUARES DO YOU WISH TO TRADE FOR SERVANTS";
  581. 550  GOSUB 2490:B3=AA:IF B3<Q/2+1 THEN 670
  582. 560  IF Z1=0 THEN 630
  583. 570  CLS
  584. 580  IF Z1=1 THEN PRINT CHR$(12):PRINT :PRINT :PRINT :PRINT :PRINT :PRINT 
  585. 590  COLOR 12:IF Z1=1  THEN PRINT "SUCH A FOOL!!  THOUGH WARNED,"
  586. 600  PRINT "YOU TRADED AWAY MORE THAN HALF THE KINGDOM."
  587. 610  PRINT "THE PEOPLE HAVE RIOTED, YOU HAVE BEEN DETHRONED AND
  588. 620  PRINT "SHALL BE BEHEADED ON THE MORROW.":GOTO 1670
  589. 630  COLOR 15:Z1=1:PRINT "SIR!!  IF YOU TRADE AWAY SUCH LAND, THE PEOPLE
  590. 640  PRINT "WILL SURELY REVOLT.  PLEASE I BEG YOU RECONSIDER."
  591. 650  IF M=4 THEN 690
  592. 660  GOTO 540
  593. 670  S=S+B3*T1:Q=Q-B3
  594. 680  GOTO 320
  595. 690  PRINT "HOW MANY SQUARES DO YOU WISH TO TRADE FOR PEASANTS";
  596. 700  GOSUB 2490:B4=AA:IF B4<Q/2+1 THEN 730
  597. 710  IF Z1=0  THEN 630
  598. 720  IF Z1=1 THEN 570
  599. 730  P=P+B4*T2:Q=Q-B4
  600. 740  M=0:A=1
  601. 750  FOR I=1 TO 1000:NEXT I:CLS
  602. 760  GOSUB 1840:COLOR 12:PRINT:PRINT "THE BARBARIANS ARE MARCHING TOWARD THE KINGDOM."
  603. 770  PRINT "YOU MUST SEND YOUR PEOPLE OUT TO FIGHT THEM OFF!":PRINT:COLOR 15
  604. 780  IF Q/5>K OR K<=1 THEN 820
  605. 790  PRINT "HOW MANY KNIGHTS  WILL YOU SEND ";:GOSUB 2490:K1=AA
  606. 800  A$="HALF YOUR KNIGHTS MUST STAY TO DEFEND THE CASTLE."
  607. 810  IF K1>K/2 THEN PRINT A$:PRINT :GOTO 790
  608. 820  IF S<2*(K-K1)+1 THEN 860
  609. 830  PRINT "HOW MANY SERVANTS WILL YOU SEND ";:GOSUB 2490:S1=AA
  610. 840  A$="SOME SERVANTS MUST STAY TO TEND YOUR KNIGHTS."
  611. 850  IF S-S1<2*(K-K1) THEN PRINT A$:PRINT :GOTO 830
  612. 860  IF P>0 THEN PRINT "HOW MANY PEASANTS WILL YOU SEND ";:GOSUB 2490:P1=AA
  613. 870  IF P>0 AND P1>P THEN PRINT "SIR, YOU HAVEN'T THAT MANY!":PRINT
  614. 880  IF N>0 THEN PRINT "HOW MANY NOMADS   WILL YOU SEND ";:GOSUB 2490:N1=AA
  615. 890  IF N>0 AND N1>N THEN PRINT "SIR, YOU HAVEN'T THAN MANY!":PRINT
  616. 900  IF N1=0 THEN 940
  617. 910  PRINT :PRINT :PRINT 
  618. 920  GOSUB 1770
  619. 930  FOR I=1 TO 1000:NEXT I
  620. 940  F
  621.