Cave Adventure

The rather imaginative initial in-game screen of Cave Adventure

Program listing on 48K Spectrum (2nd revision of program)

Program listing on 48K Spectrum (Greatly improved version by Einar Saukas)

Text Listing (Improved Version)

1 READ r,k,c,s,v:
 PRINT '"You are in a ";"cavehallpit lake"(r*4-3 TO r*4):
 INPUT u$:
 LET n=0:
 LET f=0:
 FOR i=1 TO LEN u$:
 LET v=CODE u$(1)-96:
 LET n=n+CODE u$(i)*(f>n):
 LET f=f+(u$(i)=" "):
 NEXT i:
 LET m=(v=14)*((r=1)+(r=3))-(v=19)*((r=2)+(r=4))+(v=5)*(r=2)-(v=23)*(r=3):
 LET a=r*(v=12)*(n=0)+(6-4*k-s)*(v=9)+(r=2)*(13-s)*(v=11)+(r=3)*(((1+5*s+c)*(v=12)+9*c*(1-k)*(v=15))*(n=99)+10*(c=0)*s*(v=7)*(n=115))+(r=4)*((1+4*k)*(v=12)*(n=99)+8*(v=7)*(n=107)*k)+11*ABS m:
 LET r=r+m:
 LET k=k-(a=8):
 LET c=c-(a=9):
 LET s=s-(a=10):
 PRINT ">";u$'"Can't doNothing A dragonA chest A corpseA key   A sword Closed  Taken   Opened  Taken   You walkYou diedYou won!"(a*8+1 TO a*8+8):
 POKE (a<12)*23620,2:
 DATA 1,1,1,1,0

Download the game (Original Version)
Download the game (Recommended Improved Version)

About the game

A Very simple and tiny text adventure, just to see if it was possible to in a oneliner.

Valid commands (Improved version):-

Consider the game completed once you have recieved the the "You Won!" message.

If you get stuck, then the solution (to the improved version) is in the following box (Drag mouse over to reveal hidden text):-

 
north
east
north
look
look corpse
get key
south
look
open chest
look chest
get sword
west
look
kill dragon
 

Backstory

As a young warrior apprentice, you have been chosen by the village elders to seek out the evil menace that lurks in some nearby caves. Once found, you should use any means at your disposal to defeat it. Good luck on your quest...

Acknowledgement

Again, thanks very much to Einar Saukas for greatly improving the game, by adding another location, further items. Also he improved the program output and added the inventory command.

Back to Sinclair stuff index