DRAGON'S GOLD (16K ZX80 and 16K ZX81)
by D C Owen
from ZX Computing 2, August/September 1982, pages 114-116

Here's the listing to run Dragon's Gold on the ZX80. It is followed by an
explanation of the separate subroutines within the program.

The aim of the game is simple: to accumulate as much gold as possible, while
wandering through a complex maze of tunnels, caves and doors, and to avoid the
dragon and mine shafts. You enter "A" to move ahead, "L" to move left, or "R" to
move right. Entering a space before pressing NEWLINE will cause the game to
stop. Note that the subroutine from line 9000 inverts the title. If you wish to
invert any other parts of the text, change PRINT "...whatever" to LET
V$="...whatever" and add a GOSUB 9000 line immediately after it. This will
ensure the line is automatically printed in inverse letters.


HOW IT WORKS

The subroutines are at lines:
1    'MENU'
1000 CHOICE
2000 DOOR
3000 TUNNEL
4000 CAVE
9990 'INVERSE VIDEO SUBROUTINE' (Not necessary for ZX81)

The variables used are as follows:

MENU        V$ - TITLE (Inverse video subroutine)
            K$ - 'Do you want to continue?'
            G  - Number of gold blocks (0)
CHOICE      B$ - AHEAD   D - DOOR
            L$ - LEFT    T - TUNNEL   (Choose with A$)
            R$ - RIGHT   C - CAVE
DOOR        Q  - Gold blocks
            C$ - YES/No - 'Would you like to cross the lake?'
            K  - 'Random' chance of survival
TUNNEL      *
CAVE        Q  - Gold blocks
            C$ - YES/NO - 'Would you like to investigate the noises?'
INVERSE     V$ - ZX80 only
VIDEO
SUBROUTINE

When the computer prints '>>' this means 'Do you want to continue?'
If 'YES' then simply press NEWLINE
If 'NO' then type SPACE then NEWLINE


[There is a bug in the ZX81 program which can cause an 'out of screen' error
report 5. This can be resolved by the addition of line:
   4325 SCROLL

In the ZX80 version, entering an illegal move will prompt for a new entry, but
will have cleared the screen. This can be improved by changing line 270 to go
to 60 instead of to line 172.]
