30 POKE 34,0: POKE 35,10: HOME :A$ = "YOU ARE " +ROOM$(ROOM%) +".": GOSUB 100:A$ = "": FOR I = 1 TO I%: IF LOC%(I) = ROOM% THEN A$ = A$ +LDESC$(I) +". "
40 NEXT : IF A$ < >"" THEN PRINT "HERE YOU SEE-": GOSUB 100
50 OK% = 0: FOR I = 0 TO 5:OK% = OK% +GO%(ROOM%,I): NEXT : IF OK% = 0 THEN PRINT "THERE ARE NO OBVIOUS EXITS.": GOTO 80
60 PRINT "OBVIOUS EXITS-": FOR I = 0 TO 5: IF GO%(ROOM%,I) >0 AND GO%(ROOM%,I) <100 THEN PRINT DIR$(I)" ";
70 NEXT : PRINT
80 PRINT "<-------------------------------------->";: POKE 35,24: POKE 34, PEEK(37): IF CL% THEN CL% = 0: HOME : REM 38 -'S
90 VTAB 24: RETURN
100 IF LEN(A$) <40 THEN B$ = A$:A$ = "": GOTO 130
110 FOR J = 40 TO 2 STEP -1: IF MID$ (A$,J,1) = " " THEN B$ = LEFT$(A$,J -1):L = J:J = 2
120 NEXT
130 PRINT B$: IF LEN(A$) -L >0 THEN A$ = RIGHT$(A$, LEN(A$) -L): GOTO 100
140 RETURN
150 INV$ = "": FOR I = 1 TO I%: IF LOC%(I) = 100 THEN INV$ = INV$ +LDESC$(I) +".
160 NEXT : RETURN
170 SC% = 0: FOR I = 1 TO I%:SC% = SC% +(TREASURE%(I) AND (LOC%(I) = ROOM% OR LOC%(I) = 100)): NEXT : PRINT "YOU HAVE "SC%" TREASURE";: IF SC% < >1 THEN PRINT "S";
180 PRINT " OUT OF "TN%".": IF SC% >0 AND ROOM% >3 THEN PRINT "BUT YOUR SCORE IS 0 UNLESS YOU TAKE YOURTREASURES WITH YOU TO A SAFE PLACE."
190 RETURN
200 PRINT : INPUT "YOUR ANSWER--> ";Z$:Z = VAL(Z$): ON Z = 0 GOTO 200: RETURN
210 REM MAIN PROGRAM GOES FROM 210 TO 990. THIS IS THE COMMAND ANALYZER. LINE 220 SENDS PROGRAM TO EDUCATIONAL SUBROUTINES THE FIRST TIME THE PLAYER ENTERS A LOCATION.
220 CL% = 1: GOSUB 30: IF NOT AGAIN%(ROOM%) THEN ON ROOM% GOSUB 1000,1100,1200,1300,1400,1500,1600,1700,1800,1900,2000,2100,2200,2300,2400,2500,2600,2700,2800,2900,3000,3100,3200,3300,3400
230 AGAIN%(ROOM%) = 1:TURN% = TURN% +1: INPUT "-->COMMAND: ";A$: PRINT : IF A$ = "" THEN PRINT "HUH? I DIDN'T HEAR THAT.": GOTO 960
240 REM SPECIAL COMMANDS ARE ANALYZED IN LINES 240-640.
250 IF A$ < >"BRIDGE CHASM" THEN 310
260 IF ROOM% = 6 OR (ROOM% = 5 AND BD = 2) THEN PRINT "THERE IS ALREADY A BRIDGE THERE.": GOTO 230
270 IF ROOM% < >5 THEN PRINT "WHAT CHASM?": GOTO 230
280 IF BD = 0 THEN PRINT "WITH WHAT? THE BOARD IS TOO SHORT.": GOTO 230
290 IF LOC%(3) < >100 THEN PRINT "WITH WHAT?": GOTO 230
300 BD = 2:GO%(5,2) = 6:LOC%(3) = 0: PRINT "OK. YOU PLACE THE BOARD ACROSS THE CHASMAND IT BECOMES A WIDE, SAFE BRIDGE.": GOSUB 30: GOSUB 150: GOTO 230
310 IF A$ < >"DRINK WATER" THEN 350
320 IF (LOC%(5) < >100 OR RIGHT$(LDESC$(5),1) < >"T") AND ROOM% < >9 THEN PRINT "YOU HAVE NO WATER.": GOTO 230
330 IF ROOM% <18 OR ROOM% >19 THEN PRINT "THAT WAS DELICIOUS, BUT I FEEL DIZZY ANDI CAN'T SEE CLEARLY. PRESS RETURN AND SEE IF THAT HELPS. ";: GET A$:ROOM% = 18: GOTO 220
340 PRINT "AHHH! HERE WE GO AGAIN! PRESS RETURN.";: GET A$:ROOM% = FN R(17) +( FN R(10) >5) *(2 + FN R(6)): GOTO 220
350 ON A$ < >"WAVE WAND" GOTO 380: IF LOC%(2) < >100 THEN PRINT "WHAT WAND?": GOTO 230
360 IF ROOM% < >17 OR RP THEN PRINT "NOTHING HAPPENS.": GOTO 230
370 RP = 1:GO%(1,5) = 17:GO%(17,4) = 1:ROOM$(17) = ROOM$(17) +". A ROPE HANGS OUTSIDE THE CAVE":ROOM$(1) = ROOM$(1) +". A ROPE HANGS TO A CAVE BELOW": PRINT "A ROPE DROPS FROM THE CLIFF ABOVE.": GOSUB 30: GOTO 230
380 ON LEFT$(A$,11) < >"PUSH BUTTON" AND LEFT$(A$,12) < >"PUNCH BUTTON" AND LEFT$(A$,10) < >"HIT BUTTON" AND LEFT$(A$,12) < >"PRESS BUTTON" GOTO 400:PUSH = SET: IF NOT SET THEN PRINT "NOTHING HAPPENS.": GOTO 230
390 LOC%(10) = 15: GOSUB 30: PRINT "THE CHEST OPENS. INSIDE IS A BLUE SAP- PHIRE.": GOTO 230
400 ON LEFT$(A$,8) < >"CUT ROPE" GOTO 440: IF ROOM% < >18 THEN PRINT "WHAT ROPE?": GOTO 230
410 IF LOC%(15) < >100 THEN PRINT "WITH WHAT?": GOTO 230
420 IF NOT KN THEN PRINT "THE KNIFE IS TOO DULL.": GOTO 230
430 PRINT "OK":LDESC$(14) = "A SMALL JADE STATUE": GOSUB 30:NEED%(14) = 0: GOTO 230
440 ON A$ < >"OPEN DOOR" AND A$ < >"UNLOCK DOOR" GOTO 480: IF ROOM% < >17 THEN PRINT "WHAT DOOR?": GOTO 230
450 IF DR THEN PRINT "IT'S ALREADY OPEN.": GOTO 230
460 IF LOC%(12) < >100 THEN PRINT "YOU DON'T HAVE THE RIGHT KEYS.": GOTO 230
470 GO%(17,3) = 16: GOSUB 30: PRINT "OK. THE DOOR IS OPEN.":DR = 1: GOTO 230
480 ON A$ < >"OPEN GATE" AND A$ < >"UNLOCK GATE" GOTO 520: IF ROOM% < >20 THEN PRINT "WHAT GATE?": GOTO 230
490 IF GT THEN PRINT "IT'S ALREADY OPEN.": GOTO 230
500 IF LOC%(9) < >100 THEN PRINT "YOU DON'T HAVE THE RIGHT KEY.": GOTO 230
510 GO%(20,2) = 21: GOSUB 30: PRINT "OK. THE GATE IS OPEN.":GT = 1: GOTO 230
520 ON GM$ = "" OR A$ < >GM$ GOTO 530:ROOM% = 1: GOTO 220
530 IF ( LEFT$(A$,10) = "UNTIE ROPE" OR LEFT$(A$,10) = "UNTIE KNOT") AND ROOM% = 18 THEN PRINT "YOU CAN'T. THE KNOTS ARE MAGICAL.": GOTO 230
540 IF LEFT$(A$,4) = "SWIM" AND ROOM% = 9 THEN PRINT "YOU DIDN'T BRING YOUR SWIM SUIT.": GOTO 230
550 IF LEFT$(A$,4) = "JUMP" OR LEFT$(A$,5) = "CLIMB" THEN PRINT "YOU'LL FALL.": GOTO 230
560 IF (A$ = "BREAK CHEST" AND ROOM% = 15) OR (A$ = "BREAK CASE" AND ROOM% = 18) OR (A$ = "BREAK DOOR" AND ROOM% = 17) OR (A$ = "BREAK GATE" AND ROOM% = 20) THEN PRINT "OUCH! IT'S TOO TOUGH!": GOTO 230
570 IF (A$ = "GO CAVE" AND ROOM% = 3) OR (A$ = "GO DOOR" AND ROOM% = 17 AND DR) THEN ROOM% = 4 +12 *(ROOM% = 17): GOTO 220
580 IF (A$ = "GO ROPE" AND ROOM% = 17 AND RP) OR (A$ = "GO GATE" AND ROOM% >19 AND GT) THEN ROOM% = 1 +19 *(ROOM% >19) +(ROOM% = 20): GOTO 220
590 ON A$ < >"GET WATER" GOTO 660: IF LOC%(13) < >ROOM% THEN PRINT "WHAT WATER?": GOTO 230
600 IF LOC%(5) < >100 THEN PRINT "YOU HAVE NOTHING TO HOLD IT.": GOTO 230
610 LDESC$(5) = "VASE WITH MAGIC WATER IN IT": PRINT "OK": GOSUB 150: GOTO 230
620 REM
630 REM
640 REM
650 REM COMMANDS COMMON TO MOST ADVENTURES ARE ANALYZED IN LINES 650-950. LINES 210 AND 220 ARE ALSO COMMON.
660 ON (A$ < >"I" AND LEFT$(A$,3) < >"INV") GOTO 680: IF INV$ = "" THEN PRINT "YOU HAVE NOTHING WORTH MENTIONING.": GOTO 960
670 PRINT "YOU HAVE THE FOLLOWING.":A$ = INV$: GOSUB 100: GOTO 960
680 GO% = 0: IF LEFT$(A$,2) = "GO" THEN GO% = 1:T% = 0: IF MID$ (A$,3,1) < >" " OR LEN(A$) <4 THEN PRINT "GO WHICH DIRECTION?": GOTO 960
690 A$ = RIGHT$(A$, LEN(A$) -3 *(GO% = 1)):T% = 0: FOR I = 0 TO 5: IF A$ = DIR$(I) OR A$ = LEFT$(DIR$(I),1) THEN T% = GO%(ROOM%,I):GO% = 1:I = 5
700 NEXT : IF GO% AND (T% = 0 OR T% >100) THEN PRINT "YOU CAN'T GO "A$".": GOTO 960
710 IF GO% THEN ROOM% = T%: GOTO 220
720 ITEM% = 0: IF LEFT$(A$,3) < >"GET" THEN 800
730 IF A$ = "GET" THEN PRINT "GET WHAT?": GOTO 960
740 ON ( LEFT$(A$,4) < >"GET ") GOTO 950:B$ = RIGHT$(A$, LEN(A$) -4): FOR I = 1 TO I%: IF B$ = SDESC$(I) THEN ITEM% = I:I = I%
750 NEXT : IF ITEM% = 0 THEN 950
760 IF LOC%(ITEM%) < >ROOM% THEN PRINT "I DON'T SEE WHAT YOU WANT HERE.": GOTO 960
770 IF LOC%(NEED%(ITEM%)) >0 THEN IF LOC%(NEED%(ITEM%)) <100 THEN PRINT "YOU CAN'T.": GOTO 960
780 IF LEN(INV$) + LEN(LDESC$(ITEM%)) >250 THEN PRINT "YOU CAN'T CARRY ANY MORE.": GOTO 960
860 ON (A$ < >"L" AND LEFT$(A$,6) < >"SEARCH" AND LEFT$(A$,4) < >"LOOK") GOTO 920:OK% = 0: FOR I = 0 TO 5: IF GO%(ROOM%,I) >100 THEN GO%(ROOM%,I) = GO%(ROOM%,I) -100:OK% = 1
870 NEXT : IF OK% THEN GOSUB 30: PRINT "YOU FOUND ANOTHER EXIT!"
880 KO% = 0: FOR I = 1 TO I%: IF LOC%(I) = 100 +ROOM% THEN LOC%(I) = ROOM%:KO% = 1
890 NEXT : IF KO% THEN GOSUB 30: PRINT "YOU FOUND A HIDDEN OBJECT!": GOTO 960
900 IF OK% THEN 960
910 PRINT "I DON'T SEE ANYTHING UNUSUAL.": GOTO 960
920 IF A$ = "HELP" THEN PRINT HELP$(ROOM%): GOTO 960
930 IF A$ = "SCORE" THEN GOSUB 170: GOTO 960
940 IF A$ = "QUIT" THEN GOSUB 170: PRINT "DO YOU REALLY WANT TO QUIT? ";: GET B$: PRINT B$: ON B$ < >"Y" GOTO 960: TEXT : END
960 REM USE LINES 960-980 FOR ROUTINES INVOLVING NUMBER OF TURNS (TURN%) BEFORE RETURNING TO LINE 230
970 REM
980 REM SPECIAL EDUCATIONAL SUBROUTINE FOR LOCTION N IS LOCATED IN LINES N*100+900 TO N*100+990
990 GOTO 230
1000 X = 100 + FN R(50):Y = 30 + FN R(40)
1010 PRINT "IT IS "X" FEET TO THE BOTTOM OF THE": PRINT "CLIFF. THERE IS A CAVE IN THE SIDE OF THE CLIFF "Y" FEET FROM THE TOP. HOW FAR": PRINT "IS THE CAVE FROM THE BOTTOM OF THE CLIFF?": GOSUB 200
1020 IF Z < >X -Y THEN PRINT "NO, THE HEIGHT OF THE CAVE IS THE HEIGHTOF THE CLIFF MINUS THE DISTANCE FROM THECAVE TO THE TOP OF THE CLIFF. THAT'S "X"FEET MINUS "Y" FEET, OR "X -Y" FEET.": RETURN
1030 PRINT "THAT'S RIGHT. YOU DISCOVER A ROPE HANG- ING FROM THE TOP OF THE CLIFF TO THE CAVE BELOW.":RP = 1:GO%(1,5) = 17:ROOM$(17) = ROOM$(17) +". A ROPE HANGS OUTSIDE THE CAVE":GO%(17,4) = 1: GOSUB 30: RETURN
1040 REM
1050 REM
1060 REM
1070 REM
1080 REM
1090 REM
1100 X = 50 + FN R(20):Y = 30 + FN R(20)
1110 PRINT "YOU MEET TWO LEPRECHAUNS, EACH WITH A POT OF GOLD. THE FIRST HAS "X" PIECES OF": PRINT "GOLD AND THE SECOND HAS "Y" PIECES. HOW": PRINT "MANY PIECES DO THEY HAVE BETWEEN THEM?": GOSUB 200
1120 IF Z = X +Y THEN PRINT "THAT'S RIGHT. THE LEPRECHAUNS ARE FRIGHTENED WHEN THEY SEE YOU AND RUN AWAY, LEAVING THEIR GOLD BEHIND.": RETURN
1130 PRINT "NO, "X" PIECES OF GOLD PLUS "Y" PIECES": PRINT "MAKES "X +Y" PIECES OF GOLD. THE LEPRE-": PRINT "CHAUNS RUN AWAY WITH THEIR GOLD.":LOC%(1) = 0: GOSUB 30: RETURN
1140 REM
1150 REM
1160 REM
1170 REM
1180 REM
1190 REM
1200 RETURN : REM NO EDUCATIONAL SUBROUTINE FOR ROOM OR LOCATION NUMBER 3.
1210 REM
1220 REM
1230 REM
1240 REM
1250 REM
1260 REM
1270 REM
1280 REM
1290 REM
1300 X = 20 + FN R(20):Y = 30 + FN R(20)
1310 PRINT "A LOVELY LITTLE FAIRY IS BEING ATTACKED BY "X" RATS AND "Y" BATS. HOW MANY": PRINT "NASTIES ARE AFTER HER?": GOSUB 200
1320 IF Z < >X +Y THEN PRINT "NO, "X" RATS PLUS "Y" BATS MAKES "X +Y: PRINT "MEAN LITTLE CRITTERS. THE FAIRY FLIES AWAY DOWN THE TUNNEL TO THE WEST WITH ALL THE BATS AND RATS IN PURSUIT. SOME HELP YOU ARE!": RETURN
1330 PRINT "THAT'S RIGHT. YOU SCARE THE BATS AND RATS AWAY. THE LITTLE FAIRY THANKS YOU, LAYS HER WAND DOWN IN FRONT OF YOU, AND FLIES AWAY.":LOC%(2) = 4: GOSUB 30: RETURN
1340 REM
1350 REM
1360 REM
1370 REM
1380 REM
1390 REM
1400 X = 30 + FN R(10):Y = 1 + FN R(10)
1410 PRINT "THE CHASM IS "X" FEET WIDE AND THE BOARD": PRINT "IS ONLY "Y" FEET LONG. TO BRIDGE THE": PRINT "CHASM, THE BOARD WOULD HAVE TO BE TWO FEET LONGER THAN THE CHASM IS WIDE. HOW MUCH TOO SHORT IS THE BOARD?": GOSUB 200
1420 IF Z < >X -Y +2 THEN PRINT "NO, YOU NEED TO SUBTRACT THE LENGTH OF THE BOARD FROM THE WIDTH OF THE CHASM AND THEN ADD TWO FEET TO REST ON EACH SIDE. "X" MINUS "Y" FEET PLUS TWO FEET": PRINT "IS "X -Y +2" FEET TOO SHORT.": RETURN
1430 BD = 1:LDESC$(3) = "A LONG BOARD": GOSUB 30: PRINT "VERY GOOD, MATHEMAGICIAN! THE BOARD GROWS AND IS NOW LONG ENOUGH TO BRIDGE THE CHASM.": RETURN
1440 REM
1450 REM
1460 REM
1470 REM
1480 REM
1490 REM
1500 X = 5 + FN R(4):Y = 20 + FN R(20)
1510 PRINT "HERE YOU FIND "X" GNOMES TRYING TO DIVIDE": PRINT X *Y" EMERALDS BETWEEN THEM. THEY ASK YOU": PRINT "HOW MANY EMERALDS EACH SHOULD HAVE.": GOSUB 200
1520 IF Z = Y THEN PRINT "THAT'S RIGHT. THE GNOMES LEAVE ONE EMER-ALD EACH FOR YOU AND LEAVE.": RETURN
1530 PRINT "NO, "X *Y" EMERALDS DIVIDED AMONG "X: PRINT "GNOMES IS "Y" EMERALDS EACH.":LOC%(4) = 0: GOSUB 30: PRINT "THE GNOMES TAKE THEIR EMERALDS TO LOOK FOR SOMEONE ELSE TO HELP THEM WITH THEIRPROBLEM.": RETURN
1540 REM
1550 REM
1560 REM
1570 REM
1580 REM
1590 REM
1600 X = 200 + FN R(50):Y = 350 + FN R(50)
1610 PRINT "THE VASE IS ON A PEDESTAL, AND A MESSAGEON THE PEDESTAL SAYS THE VASE WAS "X: PRINT "YEARS OLD WHEN THE LAST UNICORN DIED. THE LAST UNICORN DIED "Y" YEARS AGO. HOW": PRINT "OLD IS THE VASE?": GOSUB 200
1620 IF Z = X +Y THEN PRINT "YES, IT'S "X +Y" YEARS OLD.": RETURN
1630 PRINT "NO, TO GET THE AGE OF THE VASE YOU MUST ADD "X" AND "Y", SO THE VASE IS "X +Y: PRINT "YEARS OLD. OOPS! YOU KNOCKED IT OFF THE PEDESTAL AND IT BROKE INTO AT LEAST "X +Y: PRINT "PIECES!":LOC%(5) = 0: GOSUB 30: RETURN
1640 REM
1650 REM
1660 REM
1670 REM
1680 REM
1690 REM
1700 X = 13 + FN R(8):Y = 55 + FN R(10)
1710 PRINT "THIS IS A VERY LARGE ROOM WITH AN ENOR- MOUS STATUE IN IT. THE STATUE IS OF A GIRL HOLDING A DIAMOND OVER HER HEAD. THE BASE OF THE STATUE IS "X" FEET HIGH": PRINT "AND THE DIAMOND IS "Y" FEET ABOVE THE"
1720 PRINT "BASE. ON THE FLOOR IS A TINY LADDER. HOWLONG WOULD THE LADDER HAVE TO BE TO REACH FROM THE FLOOR OF THE CAVERN TO THE DIAMOND?": GOSUB 200
1730 IF Z = X +Y THEN PRINT "BEFORE YOU CAN SAY LONG DIVISION, THE LADDER GROWS TO EXACTLY "X +Y" FEET!":LDESC$(7) = "A LONG LADDER": GOSUB 30:NEED%(6) = 7: RETURN
1740 PRINT "NO, YOU MUST ADD THE HEIGHT OF THE BASE TO THE HEIGHT OF THE DIAMOND ABOVE THE BASE, AND THAT'S "X +Y" FEET.": RETURN
1750 REM
1760 REM
1770 REM
1780 REM
1790 REM
1800 X = 40 + FN R(10):Y = 30 + FN R(20)
1810 PRINT "THE CEILING OF THIS CAVERN IS "X" FEET": PRINT "OVER YOUR HEAD, AND THERE IS A HOLE IN THE FLOOR OF THE CAVERN WITH A POOL AT THE BOTTOM. IT IS "Y" FEET DOWN TO THE": PRINT "POOL. A MAGIC SPRING OF WATER FALLS FROM";
1820 PRINT "THE CEILING TO THE POOL. HOW FAR DOES THE WATER FALL?": GOSUB 200
1830 IF Z = X +Y THEN PRINT "THAT IS EXACTLY RIGHT.":NEED%(13) = 5: RETURN
1840 PRINT "TO GET THE ANSWER, YOU NEED TO ADD THE DISTANCE UP TO THE CEILING TO THE DIS- TANCE DOWN TO THE POOL. "X" FEET PLUS "Y: PRINT "FEET IS "X +Y" FEET.": PRINT "THE SPRING STOPS FLOWING.":LOC%(13) = 0: GOSUB 30: RETURN
1850 REM
1860 REM
1870 REM
1880 REM
1890 REM
1900 RETURN
1910 REM
1920 REM
1930 REM
1940 REM
1950 REM
1960 REM
1970 REM
1980 REM
1990 REM
2000 RETURN
2010 REM
2020 REM
2030 REM
2040 REM
2050 REM
2060 REM
2070 REM
2080 REM
2090 REM
2100 RETURN
2110 REM
2120 REM
2130 REM
2140 REM
2150 REM
2160 REM
2170 REM
2180 REM
2190 REM
2200 X = 50 + FN R(50):Y = 30 + FN R(20)
2210 PRINT "YOU GO UP "X" FEET AND DOWN "Y" FEET.": PRINT "HOW MANY FEET HIGHER ARE YOU THAN WHEN YOU STARTED?": GOSUB 200
2220 IF Z = X -Y THEN PRINT "THAT'S RIGHT.":LOC%(8) = 113: RETURN
2230 PRINT "THE CORRECT ANSWER IS "X" FEET MINUS "Y: PRINT "FEET, OR "X -Y" FEET.": RETURN
2240 REM
2250 REM
2260 REM
2270 REM
2280 REM
2290 REM
2300 X = 5 + FN R(4):Y = 15 + FN R(10)
2310 PRINT "A COLUMN OF ANTS MARCHES BY CARRYING A LARGE KEY. THERE ARE "X" ROWS OF ANTS IN": PRINT "THE COLUMN AND "Y" ANTS IN EACH ROW.": PRINT "HOW MANY ANTS ARE IN THE COLUMN?": GOSUB 200
2320 IF Z = X *Y THEN PRINT "YES, THAT'S CORRECT. THE ANTS PUT DOWN THE KEY AND MARCH OFF.":NEED%(9) = 0: RETURN
2330 PRINT "NO, YOU NEED TO MULTIPLY "X" COLUMNS BY": PRINT Y" ANTS IN EACH COLUMN. THE CORRECT AN-": PRINT "SWER IS "X *Y" ANTS.": PRINT "THE ANTS CARRY THE KEY AWAY.":LOC%(9) = 0: GOSUB 30: RETURN
2340 REM
2350 REM
2360 REM
2370 REM
2380 REM
2390 REM
2400 X = 11 + FN R(8):Y = 40 + FN R(9)
2410 PRINT "ON THE CHEST ARE "X *Y" BUTTONS DIVIDED": PRINT "INTO "X" ROWS. HOW MANY BUTTONS ARE IN": PRINT "EACH ROW?": GOSUB 200
2420 IF Z = Y THEN PRINT "THAT'S RIGHT.":SET = 1: RETURN
2430 PRINT "NO, "X *Y" BUTTONS DIVIDED BY "X" ROWS IS": PRINT Y" BUTTONS IN EACH ROW.": RETURN
2440 REM
2450 REM
2460 REM
2470 REM
2480 REM
2490 REM
2500 X = 11 + FN R(8):Y = 6 + FN R(6)
2510 PRINT "THERE ARE "Y" LARGE RUBIES HERE, ALL THE": PRINT "SAME SIZE. THERE IS A SCALE AND ONE OF THE RUBIES IS ON THE SCALE. IT WEIGHS "X"OUNCES. HOW MANY OUNCES DO ALL THE": PRINT "RUBIES WEIGH TOGETHER?": GOSUB 200
2520 IF Z = X *Y THEN PRINT "VERY GOOD.": RETURN
2530 PRINT "NO, "Y" RUBIES TIMES "X" OUNCES EACH IS": PRINT X *Y" OUNCES. OH, NO! A DWARF RAN INTO": PRINT "THE ROOM, GRABBED THE RUBIES, AND RAN AWAY!":LOC%(11) = 0: GOSUB 30: RETURN
2540 REM
2550 REM
2560 REM
2570 REM
2580 REM
2590 REM
2600 X = 5 + FN R(4):Y = 11 + FN R(8)
2610 PRINT "THERE ARE "X *Y" SMURFS HERE PLAYING A": PRINT "GAME WITH A SET OF KEYS. THE SMURFS ARE DIVIDED INTO "X" TEAMS AND ARE THROWING": PRINT "THE KEYS FROM ONE TEAM TO ANOTHER. HOW MANY SMURFS ARE ON EACH TEAM?": GOSUB 200
2620 IF Z = Y THEN PRINT "YES, THAT'S RIGHT. THE SMURFS ALL RUN AWAY LAUGHING AND LEAVE THE KEYS BEHIND.":NEED%(12) = 0: RETURN
2630 PRINT "NO, "X *Y" SMURFS DIVIDED INTO "X" TEAMS": PRINT "PUTS "Y" SMURFS ON EACH TEAM.": RETURN
2640 REM
2650 REM
2660 REM
2670 REM
2680 REM
2690 REM
2700 X = 4 + FN R(5):Y = 4 + FN R(5)
2710 PRINT "IN A CRYSTAL CASE IS A JADE STATUE. THE CASE IS BOUND SHUT WITH "X" MAGIC ROPES": PRINT "AND EACH ROPE IS TIED WITH "Y" KNOTS.": PRINT "HOW MANY MAGIC KNOTS ARE THERE?": GOSUB 200
2720 IF Z = X *Y THEN PRINT "THAT'S VERY GOOD.":KN = 1: RETURN
2730 PRINT "YOU NEED TO MULTIPLY THE NUMBER OF ROPESBY THE NUMBER OF KNOTS IN EACH ROPE. THERE ARE "X *Y" KNOTS.": RETURN
2740 REM
2750 REM
2760 REM
2770 REM
2780 REM
2790 REM
2800 X = 10 + FN R(5):Y = 25 + FN R(7)
2810 PRINT "THE HILT OF THE KNIFE IS "X" CENTIMETERS": PRINT "LONG AND THE BLADE IS "Y" CENTIMETERS.": PRINT "HOW MANY CENTIMETERS LONG IS THE KNIFE?": GOSUB 200
2820 IF Z = X +Y THEN PRINT "GOOD.": RETURN
2830 PRINT "YOU MUST ADD THE LENGTH OF THE HILT AND THE LENGTH OF THE BLADE TO GET THE TOTALLENGTH OF "X +Y" CENTIMETERS.":KN = 0: RETURN
2840 REM
2850 REM
2860 REM
2870 REM
2880 REM
2890 REM
2900 X = 20 + FN R(9):Y = 10 + FN R(5)
2910 PRINT "THE GATE IS IN THE SOUTH WALL OF THE ROOM. IT HAS "X" BARS IN IT, AND "Y" OF": PRINT "THESE HAVE SHARPENED EDGES. HOW MANY OF THE BARS ARE NOT SHARPENED?": GOSUB 200
2920 IF Z = X -Y THEN PRINT "THAT'S RIGHT, SO BE CAREFUL NOT TO CUT YOURSELF.":KEY = 1: RETURN
2930 PRINT "NOT SO. YOU NEED TO SUBTRACT "Y", THE": PRINT "NUMBER OF SHARPENED BARS, FROM "X",": PRINT "THE TOTAL NUMBER OF BARS, TO GET "X -Y", THE": PRINT "NUMBER OF UNSHARPENED BARS.": RETURN
2940 REM
2950 REM
2960 REM
2970 REM
2980 REM
2990 REM
3000 X = 20 + FN R(9):Y = 40 + FN R(9)
3010 PRINT "THE PLAQUE ON THE WALL SAYS-": PRINT "BILDAR THE WISE, WHOSE LIFE REACHED THE GOLDEN MEAN IN YEARS, LIVED "X" YEARS": PRINT "WITH NO WIFE AND "Y" YEARS WITH A WIFE.": PRINT "WHAT IS THE GOLDEN MEAN?": GOSUB 200
3020 IF Z = X +Y THEN PRINT "THAT'S RIGHT. REMEMBER THE GOLDEN MEAN.":GM$ = STR$(X +Y): RETURN
3030 PRINT "NO. TO DISCOVER THE GOLDEN MEAN, YOU MUST ADD THE "X" YEARS BILDAR LIVED BE-": PRINT "FORE HE MARRIED TO THE "Y" YEARS HE": PRINT "LIVED AFTER HE MARRIED. THE GOLDEN MEAN IS "X +Y".": RETURN
3040 REM
3050 REM
3060 REM
3070 REM
3080 REM
3090 REM
3100 X = 20 + FN R(9):Y = 15 + FN R(9)
3110 PRINT "THE PICTURE IS ON THE NORTH WALL, "X: PRINT "FEET FROM THE EAST WALL AND "Y" FEET": PRINT "FROM THE WEST WALL. HOW MANY FEET LONG IS THE NORTH WALL?": GOSUB 200
3120 IF Z = X +Y THEN TREASURE%(16) = 1: PRINT "YES, YOU'RE RIGHT. THE PICTURE LOOKS VALUABLE.": RETURN
3130 PRINT "THE LENGTH OF THE NORTH WALL EQUALS THE DISTANCE FROM THE EAST WALL TO THE PIC- TURE PLUS THE DISTANCE FROM THE WEST WALL TO THE PICTURE, OR "X +Y" FEET.":LDESC$(16) = "A WORTHLESS PICTURE": RETURN
3140 REM
3150 REM
3160 REM
3170 REM
3180 REM
3190 REM
3200 RETURN
3210 REM
3220 REM
3230 REM
3240 REM
3250 REM
3260 REM
3270 REM
3280 REM
3290 REM
3300 RETURN
3310 REM
3320 REM
3330 REM
3340 REM
3350 REM
3360 REM
3370 REM
3380 REM
3390 REM
3400 X = 2 + FN R(4)
3410 PRINT "THE RING IS ATTACHED TO A CORD WHICH HANGS FROM A HOLE IN THE CEILING. IT IS SWINGING BACK AND FORTH "X" TIMES EACH": PRINT "MINUTE. HOW MANY SECONDS DOES IT TAKE FOR THE RING TO SWING BACK AND FORTH ONCE?": GOSUB 200
3420 IF Z = 60/X THEN PRINT "YES. THE CORD BREAKS AND THE RING FALLS TO THE FLOOR.": RETURN
3430 PRINT "A MINUTE IS 60 SECONDS, DIVIDED BY "X: PRINT "SWINGS PER MINUTE IS "60/X" SECONDS PER": PRINT "SWING. SOMEONE IS PULLING THE CORD UP THROUGH THE HOLE IN THE CEILING! IT'S GONE!":LOC%(18) = 0: GOSUB 30: RETURN
3440 REM
3450 REM
3460 REM
3470 REM
3480 REM
3490 REM
3500 REM PROGRAM START-UP
3510 FOR I = 0 TO 5: READ DIR$(I): NEXT : DATA NORTH,EAST,SOUTH,WEST,UP,DOWN
3520 READ A$,RM%,I%,TN%: DIM ROOM$(RM%),GO%(RM%,5),HELP$(RM%),AGAIN%(RM%),LDESC$(I%),SDESC$(I%),LOC%(I%),NEED%(I%),TREASURE%(I%)
3530 TEXT : HOME : HTAB 20 - INT( LEN(A$)/2): PRINT A$: PRINT TAB( 13)"BY DONALD NUTE": PRINT : PRINT "** COPYRIGHT 1984 BY MICROSPARC, INC. **"
3540 PRINT "YOU ARE ABOUT TO BEGIN A GREAT ADVEN- TURE. TO PARTICIPATE IN THIS ADVENTURE, YOU MUST GIVE ME COMMANDS OF ONE OR TWO ENGLISH WORDS. I UNDERSTAND GO, HELP, SEARCH, GET, DROP, AND OTHER VERBS. I"
3550 PRINT "ALSO KNOW THE NAMES OF SEVERAL OBJECTS WHICH YOU WILL ENCOUNTER AND WHICH YOU MAY BE ABLE TO MANIPULATE BY GIVING ME THE RIGHT COMMANDS. BUT MY VOCABULARY ISLIMITED. IF ONE WORD DOESN'T WORK, TRY ANOTHER.": PRINT
3560 PRINT "DON'T FORGET TO TRY THE SEARCH AND HELP COMMANDS FROM TIME TO TIME. THEY WILL SOMETIMES UNCOVER HIDDEN OBJECTS OR GIVEVALUABLE CLUES."
3570 FOR I = 1 TO RM%: READ ROOM$(I),HELP$(I): FOR J = 0 TO 5: READ GO%(I,J): NEXT : NEXT
3580 IF I% >0 THEN FOR I = 1 TO I%: READ LDESC$(I),SDESC$(I),LOC%(I),NEED%(I),TREASURE%(I): NEXT
3590 FOR I = 1 TO RM%: IF HELP$(I) = "0" THEN HELP$(I) = "OK - HOW?"
3600 NEXT :ROOM% = 1: VTAB 24: HTAB 6: PRINT "PRESS RETURN TO CONTINUE. ";: GET A$: HOME
3610 PRINT "SOMETIMES WHEN YOU ENTER A NEW LOCATION YOU MAY BE ASKED A QUESTION. WATCH FOR THESE QUESTIONS AND ANSWER THEM CAREFUL-LY. RIGHT ANSWERS WILL HELP YOU FIND THETREASURES. YOU CAN'T GIVE A COMMAND UN- TIL YOU ANSWER THE QUESTION.": PRINT
3620 PRINT "WHEN ASKED FOR A COMMAND, YOU CAN CHANGELOCATION BY ENTERING JUST THE FIRST LET-TER OF THE DIRECTION YOU WISH TO GO - SAY D FOR DOWN. THIS SAVES TYPING.": VTAB 24: HTAB 6: PRINT "PRESS RETURN TO CONTINUE. ";: GET A$: HOME
3630 PRINT "YOU ARE AN APPRENTICE MATHEMAGICIAN. YOUHAVE LEARNED THAT NUMBERS HAVE MAGICAL POWERS AND CAN BE USED TO CONTROL THE WORLD AROUND YOU. NOW YOU WILL PUT YOUR POWERS TO THE TEST.": PRINT
3640 PRINT "YOU HAVE COME TO THE CAVE OF THE WEE CREATURES. INSIDE THE CAVE ARE TREASURESGUARDED BY MAGICAL SPELLS AND SMALL MAG-ICAL CREATURES. YOU WILL USE YOUR POWERSTO TRY TO WIN THE TREASURES OF THE CAVE."
3650 DEF FN R(X) = INT( RND(1) *X) +1
3660 VTAB 23: HTAB 4: PRINT "PRESS RETURN TO BEGIN ADVENTURE.": POKE -16368,0
3670 X = PEEK( -16384):Y = RND(1): IF X <128 THEN FOR I = 1 TO 20: NEXT : GOTO 3670
3680 POKE -16368,0: GOTO 220
3690 REM LINE 3700 CONTAINS NAME OF ADVENTURE, NUMBER OF ROOMS OR LOCATIONS, NUMBER OF OBJECTS, AND NUMBER OF TREASURES. DATA FOR LOCATION N IS FOUND IN LINE 3700+10*N IN THE ORDER: DESCRIPTION; HELP MESSAGE; NEXT ROOM N, E, S, W, U, D
3700 DATA MATHEMAGICIAN,25,18,10
3710 DATA AT THE EDGE OF A CLIFF WITH DENSE FOREST ON THREE SIDES,0,2,2,2,0,0,0
3720 DATA IN A DENSE FOREST,0,2,3,2,1,0,0
3730 DATA IN A DENSE FOREST. THERE IS A CAVE TO THE SOUTH,0,2,2,4,2,0,0
3740 DATA AT THE NORTH END OF A LONG CAVERN,0,3,0,5,7,0,0
3750 DATA AT THE SOUTH END OF A LONG CAVERN,0,4,0,0,0,0,0
3760 DATA IN A SMALL GROTTO BESIDE A CHASM,YOU'RE THIRSTY,5,0,0,0,0,0
3770 DATA IN THE VASE ROOM,0,0,4,8,0,0,0
3780 DATA IN THE STATUE ROOM,0,7,9,10,0,0,0
3790 DATA IN THE SPRING ROOM,THE WATER LOOKS DELICIOUS,0,0,0,8,0,0
3800 DATA IN A TWISTY MAZE,0,10,120,8,11,0,0
3810 DATA IN A TWISTY MAZE,0,11,10,120,12,0,0
3820 DATA IN A TWISTY MAZE,0,12,11,12,13,0,0
3830 DATA IN AN UP-AND-DOWN TUNNEL,0,12,14,0,0,0,0
3840 DATA IN A GIANT ANT HILL,YOU'RE THIRSTY,16,15,0,13,0,0
3850 DATA IN A ROOM WITH A CHEST. THERE ARE BUTTONS ON THE CHEST,I SAID THERE ARE BUTTONS ON THE CHEST,0,0,0,14,0,0
3860 DATA IN THE SCALE ROOM,0,0,17,14,0,0,0
3870 DATA IN A SMALL CAVE WITH A DOOR IN THE WEST END,SOMETIMES WANDS WORK,0,0,0,0,0,0
3880 DATA IN THE NORTH END OF A SMALL UNDERGROUND MUSEUM,THE WAY OUT IS THE WAY IN,0,0,19,0,0,0
3890 DATA IN THE SOUTH END OF A SMALL UNDERGROUND MUSEUM,THE VASE IS THE KEY,18,0,0,0,0,0
3900 DATA IN THE GATE ROOM,YOU'RE THIRSTY,11,0,0,0,0,0
3910 DATA IN THE PLAQUE ROOM,0,20,25,0,22,0,0
3920 DATA IN THE RING,0,0,21,23,0,0,0
3930 DATA IN THE RING,TRY THE GOLDEN MEAN,22,24,0,0,0,0
3940 DATA IN THE RING,0,25,0,0,23,0,0
3950 DATA IN THE RING,0,0,0,24,21,0,0
3960 REM
3970 REM
3980 REM
3990 REM
4000 REM DATA FOR OBJECT N IS IN LINE 4000+N*10 AND IS IN THE ORDER: LONG DESCRIPTION, SHORT DESCRIPTION, INITIAL LOCATION, NUMBER OF OBJECT, NUMBER OF OBJECT NEEDED TO GET, AND IDENTIFICATION AS TREASURE (1 IF YES, 0 IF NO)
4010 DATA TWO POTS OF GOLD,GOLD,2,0,1
4020 DATA A FAIRY WAND,WAND,0,0,0
4030 DATA A SHORT BOARD,BOARD,5,0,0
4040 DATA EMERALDS,EMERALDS,6,0,1
4050 DATA A PLAIN POTTERY VASE,VASE,7,0,0
4060 DATA A DIAMOND,DIAMOND,8,6,1
4070 DATA A TINY LADDER,LADDER,8,0,0
4080 DATA A SILVER BAR,SILVER,0,0,1
4090 DATA A LARGE KEY,KEY,14,9,0
4100 DATA A BLUE SAPPHIRE,SAPPHIRE,0,0,1
4110 DATA SOME RUBIES,RUBIES,16,0,1
4120 DATA A SET OF KEYS,KEYS,17,12,0
4130 DATA MAGIC WATER,WATER,9,13,0
4140 DATA JADE STATUE IN CASE BOUND WITH MAGIC ROPES,STATUE,18,14,1
4150 DATA A SMALL KNIFE,KNIFE,19,0,0
4160 DATA A SMALL PICTURE,PICTURE,22,0,0
4170 DATA A TOPAZ,TOPAZ,124,0,1
4180 DATA AN ELECTRUM RING,RING,25,0,1
4190 REM PUT DATA FOR ADDITIONAL INITIALIZATION ROUTINES HERE.