0 DATA "AN ENTRANCE CAVE LEADING TO THE NORTH.A NOTE ON THE WALL SAYS 'BRING YOUR TREASURES HERE'",0,2,0,0,0
1 DATA "A RECTANGLE SHAPED ROOM.",1,"THERE IS A GLOWING GLASS PYRAMID HERE.",17,1,3,0
2 DATA "A ROOM PAINTED FIREY RED.",1,"AN EAST DOOR IS BLOCKED BY A STONE WALL ",0,0,0,2
3 DATA "AN EAST-WEST HALL",0,0,0,5,3
4 DATA "A SMALL SQUARE ROOM.",1,"ON THE FLOOR IS A BIRD CAGE.",16,0,6,4
5 DATA "A E/W PASSAGE",0,0,0,7,5
6 DATA "THE SNAKE ROOM. PAINTED ON THE WALL IS A COBRAFIGHTING A RAT.",1,"A GIANT COBRA HISSES MENACINGLY, BLOCKING YOUR PATH TO THE NORTH AND SOUTH EXITS.",0,0,0,6
7 DATA "A MOSSY N/S TUNNEL.",0,10,7,0,0,"A SLOPING CORRIDOR , RUNNING N/S.",0,7,15,0,0
8 DATA "A SQUARE ROOM.",1,"THERE IS A STURDY OAK CHEST HERE.",11,8,0,0
9 DATA "A SHORT N/S TUNNEL.",0,12,10,0,0
10 DATA "A ROOM WITH GREEK LOOKING PAINTINGS PAINTED ON THE WALLS.",2,"AN IVORY WHITE PILLAR RISES MAJESTICLY OUT OF THE FLOOR.","ON TOP OF THE PILLAR IS A GOLDEN HORSE.",0,11,13,0
11 DATA "A SHORT E/W PASSAGE.",0,0,0,14,12
12 DATA "AN OLD LIBRARY, BUT THERE IS DUST ON THE SHELVES INSTEAD OF BOOKS.",1,"THERE IS ONE BOOK LEFT IN THE CORNER.",0,0,0,13
13 DATA "AN OCTAGONAL SHAPED ROOM.",1,"THERE IS A BOULDER HERE.",9,0,0,0
14 DATA "THE ROUND ROOM, PAINTED ON THE WALL IS APRINCE. HE LOOKS A LITTLE GREEN.",1,"THERE IS A GLOWING SAPHIRE HERE.",0,5,0,0
15 DATA "A N/S HALL",0,18,2,0,0
16 DATA "A LARGE ROOM WITH AN ARCHED CEILING.",1,"A MONGOOSE IS SLEEPING IN THE CORNER.",0,17,19,20
17 DATA "A E/W HALL.",0,0,0,23,18
18 DATA "AN E/W CORRIDOR WITH A SIDE ROOM.",0,21,0,18,29
19 DATA "A DANK, SQUARE ROOM.",1,"THERE'S A SMALL FROG STATUE HERE",0,20,22,0
20 DATA "A SMALL CLOSET.",1,"THERE'S A PEARL ON THE FLOOR !",0,0,0,21
21 DATA "A LARGE NATURAL CAVERN. A GRAVE LIES IN THE MIDDLE OF THE FLOOR.",0,24,0,0,19
22 DATA "A LONG N/S TUNNEL",0,25,23,0,0
23 DATA "A CHAMBER THAT APPEARS TO BE A PLACE OF WORSHIP.A STATUE, THE LOCAL DIETY, IS CARVED IN TO THE WALL.",1,"THERE IS A CROSS HERE THAT SAYS 'SKINNY JONES'",0,24,0,0
24 DATA "A ROOM FULL OF GARBAGE; THE STENCH DOESN'T APPEAL WITH YOUR LUNCH. IN FACT, THE GROUND SHOWES EVIDENCE THAT IT DIDN'T APPEAL TOO MANY PEOPLE'S LUNCH.",1
25 DATA "THERE IS AN UGLY GOBLIN IN THE CORNER WEARING A DIAMOND STUDDED NECKLESS.",0,27,0,0
26 DATA "A LARGE ROOM WITH A HUGE BOULDER IN THE MIDDLE OF THE FLOOR.",1,"A JEWELED SWORD IS STUCK IN THE ROCK.",26,28,0,0
27 DATA "A N/S PASSAGE",0,27,29,0,0
28 DATA "A SMALL ROOM.",1,"THERE'S A RAT SKULL HERE.",28,30,20,0
29 DATA "A TWISTING N/S HALL.",0,29,31,0,0
30 DATA "A ROUND ROOM, PAINTED ON THE WALL IS A PICTURE OF A PILLAR. SOMEONE HAS SCRIBBLED 'ZIGAL' ON IT.",0,30,0,0,0
46 CLEAR 2000:CLS:PRINT CHR$(23);" **********************"
47 PRINT " ** THE ENDLESS TOMB **"
48 PRINT " **********************"
49 PRINT:PRINT:PRINT " BY ANTHONY WOOD":DEFINT A-Z
50 R=1:DIM D$(31),I(31),I$(31,12),N(31),S(31),E(31),W(31)
55 DIM IN$(12)
60 M$="CHOP! SPLAT! YUCK!, I THINK YOU GOT IT.":M1$="IT'S BODY FADES IN TO A PILE OF DUST."
65 FM$="**-CONGRADULATIONS-** YOU HAVE SOLVED ALL THE PUZZLES!"
70 FOR T=1 TO 31:READ D$(T),I(T):IF I(T)=0 THEN 90 
80 FOR I=1 TO I(T):READ I$(T,I):NEXT 
90 READ N(T),S(T),E(T),W(T):NEXT:CLS
95 PRINT "WELCOME TO THE ENDLESS TOMB. TYPE 'SCORE' TO SEE YOUR CURRENT SCORE, A PERFECT SCORE IS 170.":PRINT 
100 PRINT "YOU'RE IN "D$(R):PRINT "THERE ARE EXITS ON THE FOLLOWING WALLS":IF N(R)<>0 THEN PRINT "NORTH. ";
110 IF S(R)<>0 THEN PRINT "SOUTH. ";
120 IF E(R)<>0 THEN PRINT "EAST. ";
130 IF W(R)<>0 THEN PRINT "WEST.";
140 PRINT:IF I(R)=0 THEN 150: ELSE FOR P=1 TO I(R):PRINT I$(R,P):NEXT 
150 INPUT H$:IF H$="LOOK" THEN 100 
160 IF H$="SCORE" THEN PRINT "YOUR CURRENT SCORE IS:";SC:GOTO 150 
165 LF$=LEFT$(H$,3)
170 IF LF$<>"INV" THEN 180
175 IF IN=0 THEN PRINT "YOUR NOT CARYING ANYTHING.": ELSE FOR T=1 TO IN:PRINT IN$(T):NEXT T:GOTO 150
180 IF H$="S" OR H$="SOUTH" THEN RR=S(R):GOTO 1040 
190 IF H$="N" OR H$="NORTH" THEN RR=N(R):GOTO 1040 
200 IF H$="E" OR H$="EAST" THEN RR=E(R):GOTO 1040 
210 IF H$="W" OR H$="WEST" THEN RR=W(R):GOTO 1040 
220 IF LF$<>"ZIG" THEN 240: ELSE B$="PILLAR":GOSUB 1180:IF F=0 THEN PRINT "NOTHING HAPPENS.":GOTO 150 
230 PRINT "THE PILLAR MAGICLY DISAPPEARS IN TO THE FLOOR.":GOSUB 1140:B$="HORSE":GOSUB 1140:I(R)=I(R)+1:I$(R,I(R))="THERE'S A GOLDEN HORSE ON THE FLOOR ":GOTO 150 
240 G$=H$:B$=" ":GOSUB 1060:IF S=0 THEN PRINT "WHAT?":GOTO 150 
250 L$=LEFT$(H$,3):RR$=RIGHT$(H$,LEN(H$)-S):R$=LEFT$(RR$,3)
255 IF L$="SAY" AND R$="ZIG" THEN H$=R$:GOTO 220
260 IF R$="PRI" THEN RR$="PLATINUM PRINCE"
270 IF R$="NEC" THEN RR$="JEWELED NECKLESS"
275 IF R$="STA" THEN RR$="FROG STATUE"
280 IF R$="HOR " THEN RR$="GOLDEN HORSE"
285 IF R$="SWO" THEN RR$="JEWELED SWORD"
290 IF R$="BIR" OR R$="CAG" THEN RR$="BIRD CAGE"
300 IF L$="GET" OR L$="PUL" OR L$="TAK" THEN 310: ELSE 440 
310 IF IN>6 THEN PRINT "YOU'RE CARRYING TOO MANY THINGS, YOU WILL HAVE TO DROP SOMETHING FIRST.":GOTO 150 
320 B$=R$:GOSUB 1180:IF F<>2 THEN PRINT "I DON'T SEE ANY ";RR$:GOTO 150 
330 IF R$="WAL" OR R$="BOU" OR R$="PIL" OR R$="ROC" THEN PRINT "IT'S TO HEAVY.":GOTO 150 
340 IF R$="COB" THEN PRINT "ARE YOU CRAZY?":GOTO 150 
350 IF R$="CAG" THEN B$="MONGOOSE IN CAGE":GOSUB 1180:IF F=2 THEN IN=IN+1:IN$(IN)=B$:B$="MONGOOSE":GOSUB 1140 
360 IF R$="MON" THEN B$="CAG":GOSUB 1180:IF F<>1 THEN PRINT "YOU PICK IT UP, BUT HE SOON SQUIRMS OUT OF YOUR GRIP":GOTO 150: ELSE PRINT "HE IS RESTING PEACEFULLY IN THE CAGE.":RR$="MONGOOSE IN CAGE":GOTO 430 
370 IF R$="HOR" THEN B$="PILLAR" THEN GOSUB 1180:IF F=2 THEN PRINT "THE PILLAR IS TOO HIGH, YOU CAN NOT REACH THE HORSE.":GOTO 150 
380 IF R$="GOB" THEN PRINT "AS YOU REACH FOR THE MONSTER, HE LETS OUT A BLOOD CURDLING YELL AND STEPS OUT OF YOUR WAY.":GOTO 150 
382 IF R<>1 THEN 390
384 IF R$="PEA" OR R$="SAP" THEN PRINT "TAKEN. YOUR SCORE JUST WENT DOWN BY 10 POINTS":SC=SC-10:GOTO 430
386 IF R$="EME" OR R$="HOR" OR R$="PRI" OR R$="RUB" OR R$="SWO" OR R$="NEC" THEN PRINT "TAKEN. YOUR SCORE JUST WENT DOWN BY 20 POINTS":SC=SC-20:GOTO 430
390 IF R$<>"SWO" THEN 420 
400 B$="BOOK":GOSUB 1170:IF F<>1 THEN PRINT "THE SWORD IS FIRMLY STUCK.":GOTO 150 
410 PRINT "YOU FEEL A SURGE OF STRENTH, AND THE SWORD EASILY SLIDES OUT OF THE ROCK":IN=IN+1:IN$(IN)=RR$:B$="SWORD":GOSUB 1130:GOTO 150 
420 IF R$="NEC" THEN B$="GOBLIN":GOSUB 1180:IF F<>0 THEN R$="GOB":GOTO 380 
430 B$=R$:GOSUB 1140:IN=IN+1:IN$(IN)=RR$:GOTO 150 
440 IF L$="BRE" OR L$="CRA" THEN 450 ELSE 490 
450 B$=R$:GOSUB 1180:IF F=0 THEN PRINT "I DON'T SEE A(N) ";RR$;".":GOTO 150 
460 IF R$<>"PYR" THEN 470: ELSE PRINT "YOU ARE SUDDENLY BLINDED BY AN INTENSE LIGHT.":B$="PYR":GOSUB 1100
465 IF R=3 THEN PRINT "WHEN YOU CAN SEE AGAIN, YOU NOTICE THE EAST EXIT IS UNBLOCKED":E(R)=4:B$="WAL":GOSUB 1130:GOTO 150: ELSE PRINT "BUT, NOTHING SEEMS AFFECTED.":GOTO 150
470 IF R$<>"SKU" THEN 480: ELSE PRINT "AS THE SKULL SHATTERS YOU SEE A RUBY, IT MUST HAVE BEEN INSIDE THE SKULL!!":B$="SKU":GOSUB 1100
472 B$="RUBY":GOSUB 1210:I(R)=I(R)+1:I$(R,I(R))="THERE ARE PIECES OF BONE HERE.":IF R=1 THEN SC=SC+20
475 GOTO 150
480 PRINT "YOU CAN'T DO THAT.":GOTO 150 
490 IF L$<>"DRO" AND L$<>"PLA" AND L$<>"PUT" THEN 590
500 B$=R$:GOSUB 1180:IF F<>1 THEN PRINT "YOU'RE NOT CARRYING THE ";RR$:GOTO 150 
505 B$="MONG":GOSUB 1170:IF F<>1 THEN 520
510 IF R$="CAG" THEN GOSUB 1100:B$="CAGE":GOSUB 1100:I(R)=I(R)+1:I$(R,I(R))=RR$:I(R)=I(R)+1:I$(R,I(R))="MONGOOSE IN CAGE":PRINT "OK":GOTO 150 
520 IF (R$="NEC" OR R$="RUB" OR R$="SWO" OR R$="EME" OR R$="HOR " OR R$="PRI") AND R=1 THEN SC=SC+20:IF SC=170 THEN PRINT FM$:END
530 IF (R$="SAP" OR R$="PEA") AND R=1 THEN SC=SC+10:IF SC=170 THEN PRINT FM$:END
540 IF R$="MON" THEN B$="COB":GOSUB 1180:IF F<>0 THEN PRINT "THE MONGOOSE CIRCLES THE SNAKE.... HE POUNCES AND EATS THE SNAKE WHOLE!":B$="COB":GOSUB 1140:N(R)=8:S(R)=9:B$="MON":RR$="FAT MONGOOSE"
550 IF R<>23 OR R$<>"CRO" OR A=1 THEN 580: ELSE PRINT "A GLOWING GHOST SLOWLY RISES OUT OF THE GRAVE AND BOOMS,' FOR THE GOOD DEED OF NAMING MY POOR SOUL I WILL REWARD YOU WITH SOME POINTS IF YOU ANSWER THIS RIDDLE CORRECTLY (1 GUESS):"
560 PRINT " WHAT CAN SLAY THE MIGHTYIST DRAGON,  CAN CHANGE THE COURSE OF RIVERS,"
565 PRINT " YET CAN NOT BE SEEN NOR SLAIN?'":INPUT A$:IF A$="TIME" THEN PRINT "YES!!":SC=SC+30: ELSE PRINT "SORRY"
570 PRINT "BOOMS THE GHOST, THEN FLOATS AWAY.":A=1
580 B$=RR$:GOSUB 1205:B$=R$:GOSUB 1100:PRINT "OK":GOTO 150 
590 IF L$<>"KIS" THEN 650 
600 IF R$<>"FRO" AND R$<>"STA" THEN PRINT "FUNNY, NOTHING HAPPENED.":GOTO 150 
610 B$="FROG":GOSUB 1180:IF F=0 THEN PRINT "THERE ISN'T A FROG HERE.":GOTO 150 
620 PRINT "WOW!!, THE FROG TURNED TO A PLATINUM PRINCE!!!":GOSUB 1100 
630 IF F=1 THEN IN=IN+1:IN$(IN)="PLATINUM PRINCE":GOTO 150 
640 B$="PLATINUM PRINCE":GOSUB 1210::IF R=1 THEN SC=SC+20:IF SC=170 THEN PRINT FM$:END
645 GOTO 150
650 IF L$="MOV" OR L$="SLI" OR L$="ROL" OR L$="PUS" THEN 660: ELSE 700 
660 IF R$="WAL" THEN PRINT "THE WALL IS VERY STRONG, YOU CAN'T MOVE IT"
670 IF R$="BOU" OR R$="ROC" AND (R=15) AND KY=0 THEN PRINT "THERE'S A KEY UNDER HERE!":KY=1:B$="KEY":GOSUB 1210:GOTO 150
680 B$=R$:GOSUB 1180:IF F<>0 THEN PRINT "OK": ELSE PRINT "I DON'T SEE ANY ROCK"
690 GOTO 150 
700 IF L$<>"OPE" THEN 760 
710 IF R$="DOO" THEN PRINT "OK":GOTO 150 
720 B$=R$:GOSUB 1180:IF F=0 THEN PRINT "I DON'T SEE A ";RR$:GOTO 150 
730 IF R$<>"CHE" THEN PRINT "WHATPRINT ":GOTO 150 
740 B$="KEY":GOSUB 1180:IF F<>1 THEN PRINT "THE CHEST IS LOCKED, YOU WILL NEED A KEY.":GOTO 100 
742 IF OC=1 THEN PRINT "OK":GOTO 150
745 IF F=1 THEN B$="CHEST":GOSUB 1100:GOSUB 1210
750 OC=1:PRINT "INSIDE THE CHEST THERE'S AN EMERALD":I(R)=I(R)+1:I$(R,I(R))="THE CHEST IS OPEN, INSIDE YOU SEE AN EMERALD!":GOTO 150 
760 IF L$="KIL" OR L$="STA" OR L$="CHO" THEN 770: ELSE 830 
770 B$="SWORD":GOSUB 1180:IF F<>1 THEN PRINT "SORRY - YOU CAN'T KILL IT WITHOUT A WEAPON.":GOTO 150 
780 B$=R$:GOSUB 1180:IF F=0 THEN PRINT "I DON'T SEE ONE.":GOTO 150 
800 IF R$="GOB" THEN PRINT M$:PRINT M1$:B$="DIAMOND STUDDED NECKLESS":GOSUB 1210:B$=R$:GOSUB 1140:GOTO 150
810 IF R$="MON" THEN PRINT M$:PRINT M1$:B$=R$:GOSUB 1140:GOTO 150 
820 GOTO 1030 
830 IF L$<>"EXA" AND L$<>"REA" THEN 930 
835 IF R$="BOU" AND R=15 THEN PRINT "THERE SEEMS TO BE SOMETHING UNDER IT.":GOTO 150
840 IF R$="GOB" THEN PRINT "THE GOBLIN IS AN UGLY, MEAN LOOKING MONSTER.":GOTO 150
850 IF R$="BOO" THEN PRINT "IT'S A BOOK OF THE KING ARTHUR LEGENDS.":GOTO 150 
860 IF R$="CHE" THEN PRINT "IT'S JUST A COMMON OAK CHEST":GOTO 150 
870 IF R$="SKU" THEN PRINT "THERE SEEMS TO BE SOMETHING INSIDE THE SKULL.":GOTO 150 
880 IF R$="WAL" THEN PRINT "IT'S A STRONG BRICK WALL":GOTO 150 
890 IF R$="PYR" THEN PRINT "IT'S A SMALL (ABOUT 3 INCH SIDES), GLOWING PYRAMID. THE PYRAMID SEEMS TO CONTAIN A GREAT ENERGY SOURCE.":GOTO 150 
900 IF R$="HOR " THEN PRINT "IT APPEARS TO BE A REPLICA OF THE TROJAN HORSE.":GOTO 150 
910 IF R$="GRA" THEN PRINT "IT'S JUST AN OLD GRAVE, BUT THERE DOESN'T APPEAR TO BE A TOMB STONE.":GOTO 150 
920 PRINT "THERE'S NOTHING SPECIAL ABOUT IT.":GOTO 150 
930 IF L$<>"KIC" THEN 980
940 IF R$="WAL" THEN PRINT "YOU STUBBED YOUR TOE, BUT DID NOTHING TO THE WALL":GOTO 150 
950 IF R$="GOB" THEN IF RND(2)=1 THEN PRINT "YOU SLIPPED ON A BANANA PEAL.":GOTO 150: ELSE PRINT "THE GOBLIN KICKED YOU BACK!!!":GOTO 150 
960 IF R$="CHE" THEN PRINT "THE CHEST SLIDES ACROSS THE FLOOR AND STOPES UNDAMAGED.":GOTO 150 
965 IF R$="MON" THEN PRINT "YOU MISS AND FALL FLAT ON YOUR BACK.":GOTO 150
970 PRINT "HUHPRINT ":GOTO 150 
980 GOSUB 1180:IF F=0 THEN PRINT "I DON'T SEE ANY.":GOTO 150
985 IF L$="RUB" THEN PRINT "NOTHING EXCITING HAPPENS.":GOTO 150
990 IF L$="BUR" THEN PRINT "YOU DON'T HAVE ANY MATCHES.":GOTO 150 
1000 IF L$="EAT" THEN PRINT "YUCK... I JUST LOST MY APPETITE":GOTO 150 
1010 IF L$="CLI" AND R$="PIL" THEN PRINT "THE PILLAR IS TOO HIGH AND SLIPPERY.":GOTO 150 
1020 IF L$="DIG" AND R$="GRA" THEN PRINT "THE GROUND IS TOO HARD TO DIG WITH YOUR HANDS, BESIDES I HEAR THAT THE MASTER OF THE TOMB IS UNFAVORABLE TO GRAVEROBBERS.":GOTO 150 
1030 PRINT "I DON'T UNDERSTAND.":GOTO 150 
1040 IF RR=0 THEN PRINT "YOU CAN'T GO IN THAT DIRECTION":GOTO 150: ELSE R=RR:GOTO 100 
1050:REM INSTR SUB
1055:REM S = POSITION OF B$ IN G$
1060 S=INSTR(G$,B$):RETURN
1090:REM SUB TO DELETE B$ FROM INVENT OR Y
1100 FOR T=1 TO IN:G$=IN$(T):GOSUB 1060:IF S=0 THEN NEXT:GOTO 1130 
1110 IN$(T)=""
1120 FOR TT=T TO IN:IN$(TT)=IN$(TT+1):NEXT:IN=IN-1:RETURN
1130:REM DELETE B$ FROM ROOM INVENTORY
1140 FOR SL=1 TO I(R):G$=I$(R,SL):GOSUB 1060:IF S=0 THEN NEXT:RETURN
1150 I$(R,SL)="":I(R)=I(R)-1
1160 FOR LL=SL TO I(R):I$(R,LL)=I$(R,LL+1):NEXT:PRINT "TAKEN.":RETURN
1170:REM SUB TO SEE IF YOU ARE CARRYING B$ OR IT'S IN THE ROOM
1175:REM IF F=0 NOT CARRYING IT OR IN ROOM
1176:REM IF F=1 CARRYING IT
1177:REM IF F=2 IN THE ROOM
1180 FOR TB=1 TO IN:G$=IN$(TB):GOSUB 1060:IF S <>0 THEN F=1:RETURN
1190 NEXT:FOR TB=1 TO I(R):G$=I$(R,TB):GOSUB 1060:IF S<>0 THEN F=2:RETURN
1200 NEXT:F=0:RETURN
1205:REM ADD B$ TO ROOM INVENTORY
1210 IF I(R)=11 THEN PRINT "THE ROOMS FULL.":RETURN:REM FIX IT!!
1220 I(R)=I(R)+1:I$(R,I(R))="THERE'S A "+B$+" HERE.":RETURN
