REM *********** section 1: initialisation **********
LET Store%(0)=0
LET Store%(1)=100
LET Store%(3)=9
LET Store%(21)=0
LET Store%(22)=-1
LET Store%(23)=0
LET Store%(24)=0
LET Store%(25)=0
REM *********** section 2: describe location *******
:movement_loop
CLS
LOOK
REM *********** section 3: Conditions 1 ************
IF Store%(3)>=78 OR Store%(3)=17 THEN GOTO player_dead
IF Store%(3)=44 AND Store%(0)=1 THEN
LET Store%(0)=0
LET Location%(9)=-1
PRINT"The serpent's eye suddenly turns to dust and disperses when a sudden gust of wind blows through the cave."
END IF
IF Store%(3)=45 AND Location%(9)=0 AND Store%(0)=0 THEN
LET Store%(0)=1
PRINT"The serpent's eye that you have been carrying suddenly begins to glow, providing enough light for you to see by in the cave."
END IF
IF Store%(3)=5 AND Store%(21)=0 THEN
PRINT " A giant eagle swoops down and attacks you. It's claws are sharp, and the bird grabs at your head with them."
LET Store%(21)=1
END IF
IF (Moved%) AND (Store%(3)=57 OR Store%(3)=58) THEN
PRINT " The passage through which you just came suddenly collapses, filling the air with dust and blocking your exit in that direction."
LET Room$(Store%(3))="You are in a small cavern. The passage you came through, to the East, is blocked and there is no other visible means of escape."
LET Room$(Store%(3))=Room$(Store%(3))+" Water drips from a point somewhere above you, forming a pool at your feet. Given time, this will fill the cavern."
LET Store%(24)=0
LET West%(Store%(3)-4)=0
END IF
REM *********** section 4: Player Input ************
:input_loop
IF (Store%(24)=6) AND (Store%(3)=57 OR Store%(3)=58) THEN
PRINT"The area around the roof of the cave where the water is leaking in is weak. It crumbles away, and the water starts to come in more rapidly. As it does so, the rock gives way a little more, and the water comes in faster still."'
LET Room$(Store%(3))="You are in a small cavern, from which there is no other visible means of escape."
LET Room$(Store%(3))=Room$(Store%(3))+" Water pours in through a gaping hole above you, forming a pool in which you now stand. It won't be long before this fills the cavern."
END IF
IF (Store%(24)=8) AND (Store%(3)=57 OR Store%(3)=58) THEN
PRINT"The area around the roof of the cave where the water is coming in collapses still further, and the water starts to pour in much more rapidly. The rock gives way a little more, and the water comes in faster still."'
LET Room$(Store%(3))="You are in a small cavern, from which there is no other visible means of escape."
LET Room$(Store%(3))=Room$(Store%(3))+" Water pours rapidly in through a gaping hole above you, forming a pool in which you now float. The cavern will very soon be filled."
END IF
PRINT'
INPUT
IF FNSaid("QUIT") THEN
QUIT
GOTO input_loop
END IF
REM *********** section 5: Conditions 2 ************
IF Store%(3)=58 OR Store%(3)=57 THEN LET Store%(24)=Store%(24)+1
IF (Store%(24)=10) AND (Store%(3)=57) THEN
PRINT"The water becomes too deep. There is no space above the surface for you to be able to hold your head up in order to breathe. You drown..."'
GOTO player_dead
END IF
IF (Store%(24)=10) AND (Store%(3)=58) THEN
PRINT"The weight of the water causes the floor below you to collapse, and you fall through into another, smaller, cave that was previously below you. The water continues to pour through and runs down the slope rapidly, deeper into the "
PRINT"cave system."
LET Store%(3)=73
GOTO input_loop
END IF
IF (Store%(3)=5 AND Store%(21)=1) THEN
IF (NOT FNSaid("FIGHT")) AND (NOT FNSaid("EAGLE")) THEN GOTO player_dead
IF Location%(3)<>0 THEN GOTO player_dead
PRINT"Using your cutlass you are able to injure the bird. Defeated, it flies off to the South."
LET Store%(21)=2
GOTO input_loop
END IF
REM ********** Section 6: Act on Input ********
IF FNSaid("NORTH") OR FNSaid("EAST") THEN GOTO do_command
IF FNSaid("SOUTH") OR FNSaid("WEST") THEN GOTO do_command
IF FNSaid("DOWN") OR FNSaid("INV") THEN GOTO do_command
IF FNSaid("HELP") THEN GOTO help
IF FNSaid("WAIT") THEN
PRINT"Okay."'
GOTO input_loop
END IF
IF FNSaid("LIGHT") AND FNSaid("WOODPILE") AND Store%(3)=9 THEN
IF Location%(4)<>0 THEN GOTO you_cant
PRINT"Using the flint, you are able to ignite the woodpile and start a signal fire. After a short while, you can see a small rowing boat approaching the shore from the direction of your ship. There are four men on board. "
PRINT"They soon reach the shore, and approach you. One of the men is the captain."'
IF Location%(8)<>0 THEN GOTO player_dead
PRINT"His face lights up with joy when he sees that you are carrying the Purple Crystal of the Heavens...."''''"Congratulations, you have completed the game!"'''
RESTART
END IF
IF (FNSaid("PUSH") AND FNSaid("BOULDER")) AND Store%(25)=0 THEN
IF Store%(3)<>76 THEN GOTO you_cant
PRINT"You push the boulder with all your strength, and eventually an passage South is revealed."
LET Store%(25)=1
LET South%(76)=45
LET North%(45)=76
LET Examine$(11)="The boulder is pressed up against the South wall of the cave"
END IF
IF (FNSaid("PUSH") AND FNSaid("BOULDER")) AND Store%(25)=1 THEN
IF Store%(3)<>76 THEN GOTO you_cant
PRINT"You push the boulder with all your strength, and eventually manage to block the passage South, since that is the only way the boulder can move."
LET Store%(25)=0
LET South%(76)=0
LET North%(45)=0
LET Examine$(11)="The boulder is pressed up against the South wall of the cave, and appears to be blocking a potential exit."
END IF
IF FNSaid("UP") AND Store%(3)=63 THEN
PRINT"The side of the cave is a very smooth rock face - too smooth to climb."
GOTO input_loop
END IF
IF FNSaid("UP") THEN GOTO do_command
IF FNSaid("OPEN") AND FNSaid("CHEST") THEN
IF Store%(23)=1 THEN GOTO you_cant
PRINT"As you open the chest the lid, which is rotten, falls apart in your hands. Inside you see a flint, a cutlass and a map."
LET List$(1)="an open chest"
LET Examine$(1)=Examine$(1)+" There is no lid, as this appears to have fallen apart."
LET Location%(3)=Store%(3)
LET Location%(4)=Store%(3)
LET Location%(5)=Store%(3)
LET Store%(23)=1
GOTO input_loop
END IF
IF FNSaid("GET") AND FNSaid("WOODPILE") AND Location%(2)=Store%(3) THEN GOTO you_cant
IF FNSaid("SWIM") THEN
LET Store%(3)=78
GOTO movement_loop
END IF
IF Store%(3)=9 AND FNSaid("READ") AND (FNSaid("PLATE") OR FNSaid("CHEST") OR FNSaid("WRIT")) THEN
PRINT "The plate on the chest's side reads 'The Stormy Sea'"
GOTO input_loop
END IF
IF (FNSaid("READ") OR FNSaid("EXAMINE")) AND FNSaid("MAP") AND (Location%(5)=0 OR Location%(5)=Store%(3)) THEN
EXAMINE MAP
LET Location%(5)=-1
PRINT "A sudden gust of strong wind takes the map and you watch helplessly as it flies into the distance. The wind almost seems to whisper to you, seemingly saying 'Leave.'"
GOTO input_loop
END IF
IF FNSaid("GET") AND FNSaid("EGG") AND Location%(6)=Store%(3) THEN
PRINT"As you lift the egg, it starts to crumble. The shell is old and weak. It crumbles further and soon becomes nothing more than dust, which the wind disperses."
LET Location%(6)=-1
GOTO input_loop
END IF
IF FNSaid("EXAMINE") AND FNSaid("EGG") AND Location%(6)=Store%(3) THEN
EXAMINE EGG
LET Location%(6)=-1
GOTO input_loop
END IF
IF Store%(3)<>40 THEN GOTO not_with_serpent
IF FNSaid("LOOK") AND Store%(22)=-1 THEN
PRINT'"You move around, trying to see what lies between and behind the rocks. As you round the largest rock, a huge serpent stands to it's full height and hisses at you."'
LET Store%(22)=0
LET Location%(10)=40
GOTO input_loop
END IF
IF FNSaid("DROP") AND FNSaid("APPLE") AND FNSaid("SERPENT") AND Location%(7)=0 AND Store%(22)=0 THEN
PRINT'"The fruit lands near the serpent, who looks at it suspiciously."'"After a moment, the creature picks it up and eats it."''"Soon after this, the creature starts to stagger about, seemingly weakened - the fruit must have been poisonous."'
LET Store%(22)=1
LET Location%(7)=-1
GOTO input_loop
END IF
IF FNSaid("FIGHT") AND FNSaid("SERPENT") AND Store%(22)=1 AND Location%(3)=0 THEN