ZX81 Programs


Read about, play, run, or list games, animations, and more. These are my programs from the ’80s to today.

ZX81 Program Listing

Gem Quest 2016 (gq2016.p)


SYSTEM VARIABLES

PROG  : 16509
D-FILE: 30070
VARS  : 30863
E-LINE: 30864
STKBOT: 30864
STKEND: 30864


LEGEND

A means INVERSE A
A means GRAPHICS A
PRINT means treat as KEYWORD P


PROGRAM LISTING

   0 REM MCII
30403 ?/INKEY$?INKEY$?CALL INKEY$
??INKEY$?  ??INKEY$?5PI?8PI?
INPUT PI?ERR MSGS CALL LN V284
IF INT £FAST STR$ ACS ?CAY-LN 5
PILN (INKEY$)(BLN UNPLOT RNDK;)
CONT 7LN UNPLOT RNDK=)HOME  LN
UNPLOT RNDK>2SLN UNPLOT RNDK)/=
LN 2INKEY$)CONT 7LN 2INKEY$)
HOME  LN 2INKEY$2SLN 2INKEY$21
LN 2INKEY$SGN LPRINT TAN FAST B
GOSUB DELETE LPRINT TAN Y0B
GOSUB DELETE S7W/RAND ;?5PI?J
LINE ?J?7TAN RND)5 FAST GOSUB
UNDRAW /RNDD7FAST ;FOR 5CHR$ 2
GOSUB PISTOP AT FOR GOSUB K
LPRINT 1Q2D6:RNDCLEAR QT5CLEAR Q
U7TAN LN V21COPY RETURN JFAST
GOSUB PILPRINT COS //LN V2G4IF
LN V2?RETURN COPY CSAVE 1COPY
RETURN JFAST GOSUB PILPRINT C
INPUT JERR MSGS 8COS 9EDIT LN XE
ASN DRNDTAN ACS UNPLOT 6ORNDEO
RND?NEW ?PCOS LN CALL INKEY$C
NEXT TAN YF( AND GOTO PICHAR Y1
ACS CK2Y4ACS DK2ACS EPRINT LN
INT INKEY$EACS ?K2INPUT ?CHAR )2
£UKRND<IF VAL INKEY$LET J4/2LET
KRETURN AS2INPUT ?/QY*( AND
GOTO PI?NEW 3DEF PROC VAL VAL
VAL JACS (ACS (ACS (POP LINE DD
AT CHAR DAT CHAR DGOSUB UNDRAW
£RNDD76:RNDAT Y/(MURNDY5)MTRND
TAN STR$ FAST VAL RETURN
8218 RNDACS AUTO C5LN ( /QE:RND
LN DO PI/CRETURN RNDABS JPI51RND
ACS AUTO C5LN ( /*E:RNDPRINT
LET E:RND?76:RND5TRNDPAT LPRINT
SGN TAN 7PRINT 6:RNDCLEAR QT5UU
RNDXMURNDRETURN 2ATN PUSH PILET
TAN U5RNDRETURN  CTXM5RND/AE£RND
1SAVE 2DQ?FAST LN CALL INKEY$C
CLS LPRINT RETURN CASN ES
RETURN ZC:RETURN D4EACS 0F?O4
CLS ?/INKEY$LN PUSH A/ABS ?LCOS
,LN 5PI<"/PRINT RETURN CALL SD
RETURN ""ACS R AND FPINEW Z5)1
CHAR 4RETURN 5K£RETURN 1C4
RETURN *S4JLN 5PIACS 5PI7/PRINT
NEW ZLN 5PIJ?APIINT F?MCIF LN O
CALL VAL UNDRAW PI)  STR$ FOR 7D
FOR D?+?0FOR KPLOT FOR FOR J?3
LINE ?3?OC/FOR JACS 0ACS 1?+?0
IF DCALL ?+DEF PROC ?0CHAR STOP
;STOP /<>LPRINT AT ACS ?TAB (
INKEY$TAN ERR MSGS ?*>=(INKEY$
FOR ?CCHAR ACS ?TAB (INKEY$TAN
GOSUB OFFMRNDONICLEAR ?RT GOSUB
DELETE /GOSUB DELETE /READ
END PROC GOSUB DELETE K176MRND
ACS WERR MSGS EDIT TAN LN   E-
RND7PRINT LN -DPOKE LN -DPOKE
LN SCHAR LN INPUT DEF PROC INT ?
LN RAUTO LN <>AUTO TAN LN LEN
AUTO YCODE LN RUN DEF PROC LN *
EDIT /$LN RAUTO 5  LN >ERR MSGS
7LN NEXT AUTO FAST LN LEN AUTO
LPRINT LN >ERR MSGS LN A
ERR MSGS LN LLIST A)CLEAR CALL 1
LN IF DEF PROC E?RNDLN INPUT
DEF PROC )RUN CALL 14 LN IF
DEF PROC E?RNDLN INPUT DEF PROC
LN .CHAR LN .CHAR YRUN LN RUN
DEF PROC Y?LN RUN DEF PROC LN
LET DEF PROC RETURN YTAB DRND5
LIST CALL FAST LN ESE?RNDDIM LN
POKE DEF PROC 4CLS INT ?
30455  
30386 DER II ENDAT YTAN ?BDPOKE 6
?RNDGOSUB OFF0RND<5?RNDLN OFF
DPOKE 5  6?RNDE?RND6?RNDLN A
DEF PROC WM5END PROC 5?RNDFAST
LN 7DPOKE LPRINT FAST 7776-RNDU*
RNDM5RNDLN -DPOKE RETURN PAUSE
ATN NEXT ERR MSGS RETURN RAND
ATN CHR$ UNDRAW RETURN IF ATN ,
EDIT RETURN THEN CREM RETURN
DIM ATN JDEF PROC RETURN GOTO
ATN ?DPOKE RETURN GOSUB ATN >
DPOKE RETURN FOR ATN PAUSE
UNDRAW RETURN NEXT ATN 2PROTECT
RETURN SLOW ATN ""AUTO RETURN
POKE ATN VAL UNDRAW RETURN FAST
ATN LAUTO RETURN INPUT ATN Y
PROTECT RETURN PLOT ATN DATA
EDIT RETURN UNPLOT ATN 6EDIT
RETURN LET ATN 2 RETURN CLS ATN
KUNDRAW RETURN STOP ASN £UNDRAW
RETURN PRINT ATN LET DPOKE
RETURN LPRINT ATN CHR$ DPOKE
RETURN NEW ATN 2DPOKE RETURN
COPY ATN UNPLOT ERR MSGS RETURN
REM CPROTECT RETURN SCROLL ATN P
UNDRAW RETURN RETURN ATN $
ERR MSGS RETURN CLEAR ATN A
DEF PROC RETURN  4;E-RND-DPOKE
RETURN
8202 2DEF PROC TAB QERR MSGS LN
£UNDRAW LN LEN AUTO YSLN RUN
DEF PROC ?DRNDLN HTRACE 5=RND?S
UNDRAW 5PUSH A?SUNDRAW 5?7?S
UNDRAW SCROLL RETURN ?4SGN LN
RUN DEF PROC 5/DPOKE LN SUNDRAW
/LEN 1RETURN RETURN GOSUB POP
ACS 1**?POKE DEF PROC UNTIL 7
RESTORE STR$ FOR FAST 67RND6SRND
LN .CHAR LN INPUT DEF PROC JLN
RUN DEF PROC LPRINT LN BREAK
DPOKE ..FOR SGN LN OFFDPOKE
GOSUB OFF?RNDLN OFFDPOKE FAST
GOSUB OFF?RNDBGOSUB DELETE
LPRINT **6?RND?SCROLL CHAR ?7?7
TAN RESTORE 7UNTIL 7TAN FAST AT
E0RND7LN NOSTALGIC DPOKE FOR B
GOSUB PISQR E?RNDGOSUB DELETE **
FOR 7/GOSUB Y?PRINT LN -DPOKE
LN DO PROTECT LN BREAK DPOKE
FOR LN NOSTALGIC DPOKE FOR LET ?
UUNDRAW YLN /DIM FAST SCROLL
RETURN
10249 C5PRINT LN RUN DEF PROC
LET LPRINT TAN VAL FAST E?RND
PRINT ?FAST 76?RNDLN POKE
DEF PROC RETURN D4-Y
52727 LN INPUT DEF PROC JLN RUN
DEF PROC LET A ?LN INPUT
DEF PROC /2LPRINT LET LPRINT AT
JTAN 5CLEAR ACS LN XUNDRAW 51
EXP LN XUNDRAW LN LET DPOKE 5
CLEAR ACS LN XUNDRAW 51:?X
UNDRAW LN -DPOKE RETURN
8198 ERROR LN -DPOKE RETURN
INKEY$CZRETURN
51890 "CYRETURN AT C?RETURN CHR$
ASN >=ERROR RETURN TAB ASN GOTO
ERROR RETURN ,ASN OERROR PRINT E
-RND7LET 1TERROR VAL 1  VAL 1M
TRACE VAL ?CHAR UNDRAW 5INPUT
DEF PROC LN SUNDRAW /RESEQ 5RND
TRACE LN SUNDRAW /7LN LOOP
ERROR 5IF DEF PROC LN SUNDRAW /
CHAR Y?LN BDPOKE E?RNDFAST LN X
UNDRAW 1COPY COPY LN TRACE  7
PRINT LN RUN DEF PROC LET
RETURN "C5LN BDPOKE /INPUT
LPRINT VAL GOSUB OFF?RNDLN OFF
DPOKE Y)LN UUNDRAW Y1LPRINT ?U
UNDRAW LN IUNDRAW LN SQR UNDRAW
5CALL EDIT LN XUNDRAW 5PRINT A
LN SUNDRAW LN -DPOKE RETURN ,C>
RETURN ;ASN CLS DPOKE RETURN +
ASN CLS DPOKE 5.CHAR LN SUNDRAW
JTAN 5XERROR LN SUNDRAW ?CLS
DPOKE 51RNDACS AUTO TAB :"JLN
RUN DEF PROC UTRNDRETURN )S
UNDRAW :(Y/5URND-CHAR ?PRINT A
LN ERR MSGS UNDRAW Y?LN BDPOKE 5
RUN DEF PROC LN SUNDRAW /JLN H
TRACE 5RUN ERROR LN SUNDRAW /8?
NEW 3DEF PROC 51RNDACS AUTO C:5S
RND-ACS COPY LEN WUSR ?A?2DUTRND
CHR$ 5QUNPLOT .CHAR /RY
50167 LN ABS 5IF DEF PROC LN S
UNDRAW ?.ERROR LN NOSTALGIC
DPOKE STR$ LN NOSTALGIC DPOKE
STR$ AT SGN TAN RETURN RNDABS
CONT ERR MSGS 1WRND2LN LINE
CALL RETURN 0SSRETURN RNDKTLN -
DPOKE 7/INPUT RETURN (ME
END PROC C4RETURN $4272SACS
COPY 2LN 6CHAR A ?DDGOSUB
UNDRAW ?RNDDCHAR UEEND PROC
RETURN $CARETURN (42JTAN ?TAN Y1
TAN E4RND91WRNDJMTEND PROC SY
ACS ?4KACS LIST ACS RNDFAST 5T
END PROC OASN CONT ERR MSGS
LPRINT ?FFAST LN SCROLL CHAR
LPRINT 7ACS ?CNEXT J?6DEND PROC
UTEND PROC LN DPEEK CHAR RETURN
14"Y5LN UUNDRAW 5SAVE CHAR LN S
UNDRAW UTEND PROC 55END PROC
ERROR 4S**?TAN EDEND PROC )M 
GOSUB DELETE GOSUB OFF?RNDGOSUB
DELETE SQR INT 6FAST LN
NOSTALGIC DPOKE ?NLPRINT ""
GOSUB OFF1END PROC LN OFFDPOKE )
  LN OFFDPOKE E?RNDGOSUB OFF1
END PROC ;61END PROC 1  ?COS :
LN -DPOKE LN SCHAR RETURN 1ASN
RESEQ RETURN  4SLN DPOKE ACOPY
FAST LN -DPOKE RETURN =TAB CONT
ERR MSGS LN HTRACE LPRINT ?
RETURN COPY 4£5SGN FOR LN X
UNDRAW 5OFFDPOKE ?SUNDRAW Y6?U
UNDRAW FAST 5NOSTALGIC TRACE LN
SUNDRAW LN -DPOKE LN LINE CALL
RETURN (46LPRINT LN ** 5STR$
VAL LN XUNDRAW 5DUP DEF PROC LN
SUNDRAW LN -DPOKE LN 3 5AT SGN
LN XUNDRAW 5?DEF PROC ?SUNDRAW
LN -DPOKE LN 3 LPRINT Y5LN U
UNDRAW 5?TRACE ?SUNDRAW I+FAST
LN -DPOKE RETURN (CRAND RETURN "
45LN LOOP ERROR /END WHEN
RETURN INKEY$4A5RNDTRACE LN S
UNDRAW /USER RETURN CHR$ 4"LN
ERR MSGS UNDRAW 5UTRACE LN S
UNDRAW /DELETE LN ABS /EDIT LN
SCHAR LN -DPOKE FAST LN LINE
CALL RETURN (4NLN -DPOKE LN H
TRACE E-RNDDATA LOOP LN XUNDRAW
/"LN -DPOKE RETURN TO TAB CONT
ERR MSGS LN OUNDRAW 5AUTO TRACE
LN SUNDRAW LPRINT Y5LN UUNDRAW 5
WHILE TRACE ?SUNDRAW LPRINT Y5
LN UUNDRAW 5HCHAR ?SUNDRAW 5
LINE TRACE LN SUNDRAW LN LINE
CALL RETURN )CDLPRINT X""LN -
DPOKE ?5 LN -DPOKE /FOR ?11 /D
LN POKE DEF PROC 1  GCOS £)D
END PROC >TAN B.GOSUB DELETE
ERR MSGS EDIT LIST INT FSTR$ LN
NOSTALGIC DPOKE FOR SGN ;FOR
TAN E1END PROC 65END PROC TAN ?L
COS E5END PROC FOR GOSUB KGOSUB
DO 5END PROC TAN FAST E5
END PROC GOSUB OFF1END PROC B
GOSUB DELETE FAST AT LPRINT LN
NOSTALGIC DPOKE VAL FAST LN ?
DEF PROC LPRINT AT ?7?TAN FOR TA
?RETURN  C1ACS  DRAW ?FOR 5  
ACS T3K1;FOR DFOR (PRINT TAN J
PRINT LN ERR MSGS UNDRAW LN
LINE CALL RETURN + AND RNDDRAW
RETURN ;ABS RNDDRAW YFAST LN B
DPOKE LN -DPOKE PRINT LN
ERR MSGS UNDRAW LET RETURN +C4
RETURN -47AT LINE ?RETURN  44
PRINT FAST /PEEK FAST 5ERR MSGS
EDIT LN XUNDRAW LN NEXT TRACE Y
FAST 5PUSH NOSTALGIC LN UUNDRAW
/ZPRINT VAL /0RETURN /C(RETURN *
TAB CONT ERR MSGS LN VDRAW 5)
TRACE LN SUNDRAW /BLN VDRAW 5
CLEAR DEF PROC /NEXT YLPRINT LN
BDPOKE LET RETURN  COS RETURN +C
)LN VDRAW 5BFOR LN XUNDRAW 5
GOSUB DELETE LN XUNDRAW /SCROLL
LN VDRAW Y;LN BDPOKE /<>YSGN ?B
DPOKE RETURN )4USR LN -DPOKE /
INT RETURN PEEK 4?LN ERR MSGS
UNDRAW 5A ?XUNDRAW RETURN USR 4>
LN ERR MSGS UNDRAW 5PUSH DRAW ?S
UNDRAW 1?DRAW VAL FAST TAN
NOSTALGIC PUSH TAN RETURN CODE 4
G55END PROC YELN UUNDRAW YFAST
LN BDPOKE ICOPY LN 5 YSGN LN B
DPOKE 5>DRAW /USR E5END PROC
GOSUB DO 5END PROC JGOSUB
DELETE LINE ?COS ,?TAN RETURN
RND455ARND/VRETURN ABS 4)LN
ERR MSGS UNDRAW 5ACS ?LN X
UNDRAW YCODE 5?UNDRAW ?UUNDRAW
RETURN INT ASN ERR MSGS UNDRAW
RETURN LEN 4,LN -DPOKE LN SCHAR
LN -DPOKE Y5LN UUNDRAW 5>=DRAW /
F77LN NOSTALGIC DPOKE FOR TAN
RETURN SGN 4+LN ERR MSGS UNDRAW
5LIST DRAW ?SUNDRAW ?PCOS ACS ?5
1 TAB ?UNDRAW TAN RETURN SQR
TAB CONT ERR MSGS LN ERR MSGS
UNDRAW 5SUNDRAW ?SUNDRAW JXACS ?
C2INT G?ELSE A )RND TAGOSUB
DELETE K1;ZACS >EGOSUB
CLR STACK EGOSUB CLR STACK (
LIST CLR STACK LINE TAN LN H
TRACE LN -DPOKE PRINT YFAST LN B
DPOKE LN HTRACE YSGN LN BDPOKE
LET TAN LN -DPOKE RETURN -PRINT
ATN -DPOKE RETURN (C-RETURN RNDK
$RETURN AUSR ?UNDRAW >=8UNDRAW
LET ATN ELSE UNDRAW TAN LN
TRACE DRAW /PLOT LN HTRACE /LET
5?UNDRAW /CHAR ?JLINE ?J?7TAN
LN SCHAR RETURN  ASN >DEF PROC Y
E/PLN DO PROTECT Y5/I)(BLN A
DPOKE LN $ERR MSGS U5END PROC
DEF PROC £E?RND6?RNDT4LN BDPOKE
(CLS $4PLOT LPRINT GOSUB UNDRAW
?RNDTAN 5ES/75"RNDYLN LN BDPOKE
?LN BDPOKE ??BDPOKE LN IUNDRAW
LN SQR UNDRAW 5FOR ?/GOSUB
RETURN ,TAB CONT ERR MSGS TAN
LN LINE CALL RETURN
10245 TRACE /AYE5ORNDLN UUNDRAW Y
65MRND?UUNDRAW LN -DPOKE LN S
CHAR FAST FAST LN -DPOKE LN I
UNDRAW Y7LN BDPOKE 5GOSUB DO LN
XUNDRAW LPRINT LN XUNDRAW Y677
LN UUNDRAW LPRINT GOSUB OFF?RND?
OFFDPOKE LN -DPOKE LN SCHAR
FAST FAST YELN UUNDRAW 576LN X
UNDRAW LPRINT LN XUNDRAW 77Y
GOSUB LN BDPOKE YOFFLN UUNDRAW Y
B5GOSUB DELETE LN UUNDRAW YIF
LPRINT LN NOSTALGIC DPOKE FOR ?U
UNDRAW 5  /?LN -DPOKE RETURN  
LN )TRACE LET RETURN AABS CONT
ERR MSGS RETURN 0 AND CONT
ERR MSGS CHR$ 0T DEF PROC D/ TO
FAST E-RND)5 ;6-RNDLPRINT TAN
LN -DPOKE LN SCHAR RETURN 1C1
PRINT FAST 5*EDIT LN SUNDRAW
LPRINT LET RETURN  TAB EXIT Y
FOR LN BDPOKE LN SUNDRAW Y5LN U
UNDRAW LN -DPOKE 5VPROTECT ?S
UNDRAW GOSUB UNDRAW 1END PROC
VAL FAST LN 2EDIT 61END PROC
FAST LN PAUSE PROTECT RETURN
10249 KPRINT LN $EDIT /LIST SGN
GOSUB DELETE FAST AT LPRINT LN 6
TRACE AT GOSUB CALL 1END PROC
FAST LN 2EDIT 1LN ?DEF PROC
LPRINT TAN FAST LN LET DEF PROC
LPRINT RETURN ?""J?FY
48672 £RND1SAVE 2DYL?TAN ?7Y
48672 /PAUSE LN 2EDIT FAST FAST
LN PAUSE PROTECT RETURN
10257 CARETURN 0SLET RETURN AK
GOSUB LN $EDIT /CONT 5  SGN ,
RETURN -C(RETURN LC?CHR$ 0DFAST
DDAT DT DEF PROC D</CONT SGN ,
RETURN -PRINT LN NEW PROTECT
LET ""??UNDRAW Y.PRINT LN I
UNDRAW LN SQR UNDRAW 5UNDRAW
DPOKE LN XUNDRAW YYLN BDPOKE
LET LN BDPOKE YM5KRNDLN UUNDRAW
5,RND?SUNDRAW Y4/**?PCOS ?NCOS R
TAN ?PC2RTAN ?NCOS RTAN E-RND7(C
PLOT RETURN INKEY$ASN ERR MSGS
AUTO RETURN CHR$ ASN ERR MSGS
AUTO RETURN "ASN ERR MSGS AUTO 7
LN IUNDRAW RETURN OR 4S5?EDIT
LN SUNDRAW YABS /CHAR RETURN
AND 455EEDIT /LIST PRINT YB5
GOSUB DELETE LN UUNDRAW LET
RETURN =44YTAB /GRETURN <>44Y
ASN /8RETURN >C+RETURN <4EYASN
LN 5AUTO /<RETURN >=4S5C7LN X
UNDRAW YPAUSE /ERETURN <=TAB
CONT ERR MSGS YIF LN 5AUTO LN -
DPOKE RETURN AND ASN ,EDIT TAN
LN BDPOKE ESRND7LN BREAK DPOKE
FOR LN NOSTALGIC DPOKE FOR ?X
UNDRAW LN XAUTO 65END PROC 6E
END PROC TAN E5END PROC QCOPY 7
TAN 5NOSTALGIC TRACE LN SUNDRAW
LN 3 LN -DPOKE PRINT 5NAUTO LN S
UNDRAW LN 3 5XAUTO LN SUNDRAW 52
AUTO LN SUNDRAW LET RETURN =44Y
TAB /ARETURN <>44YASN /2RETURN >
4EYASN LN 5AUTO /ARETURN <C<
RETURN >=44Y AND /ERETURN <=TAB
CONT ERR MSGS 5C7LN XUNDRAW Y
ABS ?+AUTO EEEND PROC GOSUB
UNDRAW 1END PROC SWOY""RETURN  
COS 77/POKE 5RAUTO ?SUNDRAW LN
SCROLL 25VRNDACS QTAN 5LEN AUTO
?SUNDRAW 5VRNDACS PLOT ?E252 LN
**D""FAST LN 2DEF PROC SGN ?
DATA S52 LN **D""LN 2DEF PROC
COS LN 2DEF PROC COS LOOP DATA E
£RND/SCROLL 777VAL 7777VAL LN
EXP AUTO 57 LN **DAT LN 2D7Y
28963 7AT ?7?7QREM 7?7?7TAN 77
AUTO 7ERROR D7U£RND1""U$RND0TAN
LN -DPOKE LN SCHAR Y5LN UUNDRAW
YGOSUB LN BDPOKE YOFF51END PROC
LN UUNDRAW 5OFFDPOKE LN SUNDRAW
LN HTRACE 5UNTIL DEF PROC ?S
UNDRAW 7D7FAST FAST AT E1
END PROC LN COS :AT LN DUP
DEF PROC GOSUB DO 1END PROC TAN
E1END PROC DATA LOOP <Q /7E1
END PROC ?LCOS GOSUB KTAN FAST
LN ERR MSGS UNDRAW 5GOSUB
UNDRAW LN XUNDRAW LPRINT LN X
UNDRAW 5DD?XUNDRAW LN DPOKE 5
NOSTALGIC DPOKE LN SUNDRAW 5FOR
SGN ?XUNDRAW E4RND9QCOPY FQCOPY
FQ 6DEND PROC Y5E?RNDLN UUNDRAW
I:U5END PROC LINE LN XUNDRAW 5
ATN DEF PROC ?SUNDRAW £JM5RNDT4?
7(UNPLOT $4RUN 54 6?RNDE0RND1
HOME  D61END PROC 65END PROC
TAN ?HRND?:RND?)RND?1RND?4RND
FOR ?7RNDY?N(REM
30241 :2LN ATN DEF PROC LN ES5/
NOSTALGIC :1LN ATN DEF PROC ?
DRAW END PROC Q GEM QUEST ** FRA
CTURED WORLD W)EEND PROC 1LN
IF DEF PROC LN .CHAR 51 FAST 5= 
SGN 7GOSUB DO 4NOSTALGIC 66
NOSTALGIC ?CLR STACK END PROC  )
PUSH END PROC 11 LN IF DEF PROC
5+ LN RUN ERROR ?EEND PROC      
      )?END PROC 1LN IF
DEF PROC E4NOSTALGIC 764
NOSTALGIC GOSUB OFF6NOSTALGIC B
GOSUB DELETE IF DPEEK END PROC ?
CODE END PROC R                 
             E)8END PROC 1LN
IF DEF PROC 5D FAST 5- SGN CALL
EDIT LN PRINT A?NEW END PROC    
      )<>END PROC 1D LN IF
DEF PROC LN .CHAR 5£RND 1FAST 5$
RND)TRACE FAST 51 ERR MSGS EDIT
LPRINT SGN ;FAST PUSH NOSTALGIC
SGN ;68NOSTALGIC LN POKE DATA 5 
 6CNOSTALGIC 5  6GNOSTALGIC 55 6
KNOSTALGIC 5S 6ONOSTALGIC 5HOME
 6SNOSTALGIC 5HOME  6WNOSTALGIC
51 6RNDNOSTALGIC 5  6ERR MSGS
NOSTALGIC 5COS  6 NOSTALGIC LN
SGN OFF?RESTORE DONE.)INDENT 15 
LN IF DEF PROC LN .CHAR LN IF
LOOP LN ADELETE ?CLR STACK E4
NOSTALGIC 6PROTECT NOSTALGIC E4
NOSTALGIC FAST 5  SGN BGOSUB
DELETE ASN -IF -E4NOSTALGIC
FAST 5- SGN ;6PROTECT NOSTALGIC
E4NOSTALGIC FAST 5+ SGN BGOSUB
DELETE PAUSE NE4NOSTALGIC FAST 5
SGN BFOR GOSUB DELETE 6
PROTECT NOSTALGIC ELOOP
NOSTALGIC 6END PROC NOSTALGIC E
LOOP NOSTALGIC FAST 5  SGN B
GOSUB DELETE ASN CHR$ IF CHR$ E
LOOP NOSTALGIC FAST 54 SGN ;6
END PROC NOSTALGIC ELOOP
NOSTALGIC FAST 53 SGN BGOSUB
DELETE PAUSE NEXT ELOOP
NOSTALGIC FAST 54 SGN BFOR
GOSUB DELETE 6END PROC
NOSTALGIC 51 FAST 54 FAST E
PROTECT NOSTALGIC SGN LN )TRACE
FAST EEND PROC NOSTALGIC
ERR MSGS EDIT LPRINT SGN ;FAST
PUSH NOSTALGIC SGN ;6WHEN
NOSTALGIC EWHEN NOSTALGIC GOSUB
UNDRAW NOSTALGIC NOSTALGIC DD
STR$ LN NOSTALGIC DPOKE FOR SGN
6CURSOR NOSTALGIC TAN E
NOSTALGIC FAST 5  SGN BGOSUB
DELETE PAUSE CALL DELETE E
NOSTALGIC FAST 51 SGN BFOR
GOSUB DELETE 6 NOSTALGIC E
NOSTALGIC FAST 51 SGN BGOSUB
DELETE ASN ONDELETE IF ONDELETE
ESNOSTALGIC FAST 51 SGN BFOR
GOSUB DELETE 6SNOSTALGIC ES
NOSTALGIC FAST 51 SGN BGOSUB
DELETE ASN ?DELETE IF ?DELETE ?)
RESEQ EKNOSTALGIC 64NOSTALGIC EO
NOSTALGIC 6LOOP NOSTALGIC EHOME
NOSTALGIC FAST 5W SGN BGOSUB
DELETE TAB 4DELETE EKNOSTALGIC
FAST 51 SGN BFOR GOSUB DELETE 64
NOSTALGIC E4NOSTALGIC FAST 5  
SGN BGOSUB DELETE ASN RDELETE
IF RDELETE 5+ 64NOSTALGIC EHOME
NOSTALGIC FAST 5S SGN BGOSUB
DELETE TAB SGN DELETE EK
NOSTALGIC FAST 51 SGN ;64
NOSTALGIC E4NOSTALGIC FAST 5+ 
SGN BGOSUB DELETE PAUSE FAST
DELETE 5  64NOSTALGIC EHOME
NOSTALGIC FAST 5A SGN BGOSUB
DELETE TAB 2DO EONOSTALGIC FAST
51 SGN BFOR GOSUB DELETE 6LOOP
NOSTALGIC ELOOP NOSTALGIC FAST 5
  SGN BGOSUB DELETE ASN ;DO IF ;
DO 53 6LOOP NOSTALGIC EHOME
NOSTALGIC FAST 5D SGN BGOSUB
DELETE TAB NDO EONOSTALGIC FAST
51 SGN ;6LOOP NOSTALGIC ELOOP
NOSTALGIC FAST 53 SGN BGOSUB
DELETE PAUSE CHAR DO 5  6LOOP
NOSTALGIC LN ?ECURSOR NOSTALGIC
FAST 51 SGN BGOSUB DELETE TAB
OFFDO ?STOP LOOP ECURSOR
NOSTALGIC FAST 55 SGN BGOSUB
DELETE TAB ELSE DO ?STOP LOOP E4
NOSTALGIC 6KNOSTALGIC ELOOP
NOSTALGIC 6ONOSTALGIC EHOME
NOSTALGIC FAST 5W SGN BGOSUB
DELETE TAB ,DO ?:DO NORTH)GDO 15
 LN IF DEF PROC LN .CHAR EHOME
NOSTALGIC FAST 5W SGN BGOSUB
DELETE TAB DDO TAN EHOME
NOSTALGIC FAST 5S SGN BGOSUB
DELETE TAB ACS DO ?ZDO SOUTH)U
DO 15 LN IF DEF PROC LN .CHAR E
HOME NOSTALGIC FAST 5S SGN B
GOSUB DELETE TAB AND DO TAN E
HOME NOSTALGIC FAST 5A SGN B
GOSUB DELETE TAB CLS DO ?LOAD
DO WEST)FOR DO 14 LN IF
DEF PROC LN .CHAR EHOME
NOSTALGIC FAST 5A SGN BGOSUB
DELETE TAB SLOOP TAN EHOME
NOSTALGIC FAST 5D SGN BGOSUB
DELETE TAB FLOOP ?3LOOP EAST).
LOOP 14 LN IF DEF PROC LN .CHAR
EHOME NOSTALGIC FAST 5D SGN B
GOSUB DELETE TAB ULOOP TAN E
HOME NOSTALGIC FAST 5H SGN B
GOSUB DELETE TAB RESEQ LOOP ?
AUTO LOOP HIT)UNDRAW LOOP 17 LN
IF DEF PROC LN .CHAR EHOME
NOSTALGIC FAST 5H SGN BGOSUB
DELETE TAB DUP LOOP ?IF WHEN E
HOME NOSTALGIC FAST 5Q SGN B
GOSUB DELETE TAB £LOOP ? LOOP QU
IT)?LOOP 14 LN IF DEF PROC LN .
CHAR EHOME NOSTALGIC FAST 5Q 
SGN BGOSUB DELETE TAB 1LOOP ?1
UNTIL EHOME NOSTALGIC FAST 5E 
SGN BGOSUB DELETE TAB ZLOOP ?N
LOOP ENTER)ILOOP 15 LN IF
DEF PROC LN .CHAR EHOME
NOSTALGIC FAST 5E SGN BGOSUB
DELETE TAB SQR LOOP ?ZUNTIL ?
CHR$ LOOP ZZZ)PEEK LOOP 17 LN
IF DEF PROC LN .CHAR TAN ?GOSUB
LOOP NO MOVE)NEW LOOP 1E LN IF
DEF PROC LN .CHAR TAN 52 FAST 5-
 SGN CALL EDIT LN PRINT A??EXIT
GOLD:)SEXIT 15 LN IF DEF PROC EW
NOSTALGIC LN INPUT DEF PROC ?6
EXIT  )5EXIT 11 LN IF DEF PROC 5
7 FAST 5- SGN CALL EDIT LN
PRINT A?RNDEXIT HLTH:)VEXIT 15 
LN IF DEF PROC ESNOSTALGIC LN
INPUT DEF PROC ?DO EXIT  )
DELETE EXIT 11 LN IF DEF PROC 54
 FAST 5- SGN CALL EDIT LN PRINT
A??EXIT FOOD:)ELSE EXIT 15 LN
IF DEF PROC E NOSTALGIC LN
INPUT DEF PROC ?REXIT  )6EXIT 11
 LN IF DEF PROC 5T FAST 5- SGN
CALL EDIT LN PRINT A?8EXIT WORLD
: )1EXIT 1E LN IF DEF PROC ERND
NOSTALGIC LN INPUT DEF PROC 5E 
FAST 5- SGN CALL EDIT LN PRINT A
?ASN EXIT GEMS:  )?EXIT 1E LN
IF DEF PROC EERR MSGS NOSTALGIC
LN INPUT DEF PROC LN .CHAR LN
DPOKE DATA ?STOP EXIT >)LLIST
EXIT 11 LN IF DEF PROC LN J
RESEQ EHOME NOSTALGIC FAST 5  
SGN BGOSUB DELETE PAUSE RETURN
EXIT TAN ?GOTO EXIT LN DPOKE
DATA ?£UNTIL START)EUNTIL 15 LN
IF DEF PROC LN .CHAR LN DPOKE
DATA ?BUNTIL OVER? Y/N)2UNTIL 1D
 LN IF DEF PROC LN .CHAR LN IF
LOOP EHOME NOSTALGIC FAST 5N 
SGN BGOSUB DELETE TAB DELETE
UNTIL ?TRACE UNTIL NO)CHAR
UNTIL 12 LN IF DEF PROC EHOME
NOSTALGIC FAST 5Y SGN BGOSUB
DELETE TAB ?UNTIL ?DPEEK UNTIL Y
ES)ONUNTIL 17 LN IF DEF PROC E
HOME NOSTALGIC FAST 5N SGN B
GOSUB DELETE TAB YUNTIL 5>=£LN
PUSH DRAW 64NOSTALGIC EHOME
NOSTALGIC FAST 5Y SGN BGOSUB
DELETE ASN *UNTIL ?NUNTIL LN
DPOKE DATA ?8UNTIL OKAY...)1
UNTIL 1E LN IF DEF PROC LN .
CHAR LN DPOKE DATA LN DPOKE
DATA LN DPOKE DATA LN DPOKE
DATA ?,LN DPOKE DATA ECURSOR
NOSTALGIC FAST 5T SGN BGOSUB
DELETE TAB PEEK UNTIL ?4WHILE E
CURSOR NOSTALGIC FAST 5E SGN B
GOSUB DELETE TAB RUN UNTIL ?FOR
UNTIL DUNGEON)SLOW UNTIL 1E LN
IF DEF PROC LN .CHAR ECURSOR
NOSTALGIC FAST 5T SGN BGOSUB
DELETE ASN 3WHILE IF 3WHILE ?<
WHILE NOT HERE)"WHILE 1A LN IF
DEF PROC LN .CHAR TAN ?BWHILE CI
TY)7WHILE 14 LN IF DEF PROC LN .
CHAR LN DPOKE DATA ?RNDWHILE FOO
D OR)TWHILE 1E LN IF DEF PROC
LN .CHAR LN DPOKE DATA ?INDENT
WHILE HEALTH?)DELETE WHILE 1E 
LN IF DEF PROC LN .CHAR LN IF
LOOP 5  6POP NOSTALGIC EHOME
NOSTALGIC FAST 5F SGN BGOSUB
DELETE TAB WWHILE 51 6POP
NOSTALGIC EHOME NOSTALGIC FAST 5
SGN BGOSUB DELETE TAB 7WHILE ?
*WHILE FOOD)<WHILE 14 LN IF
DEF PROC LN .CHAR EHOME
NOSTALGIC FAST 5H SGN BGOSUB
DELETE TAB RWHILE 52 6POP
NOSTALGIC EHOME NOSTALGIC FAST 5
SGN BGOSUB DELETE TAB AND
WHILE ?EXP WHILE HEALTH)COS
WHILE 1T LN IF DEF PROC LN .
CHAR EPOP NOSTALGIC FAST 5  SGN
BGOSUB DELETE TAB FOR WHILE ?<>
INDENT LN DPOKE DATA ?IF WHILE H
OW MANY?)LET WHILE 1D LN IF
DEF PROC LN .CHAR LN DPOKE DATA
?<WHEN 1-9 X10)£WHEN 1E LN IF
DEF PROC LN .CHAR LN IF LOOP E
HOME NOSTALGIC FAST 50 SGN BFOR
GOSUB DELETE FAST 5S SGN LN )
TRACE 6HOME NOSTALGIC EHOME
NOSTALGIC FAST 5S SGN BGOSUB
DELETE ASN EDIT WHEN IF EDIT
WHEN ?<>INDENT EHOME NOSTALGIC
FAST 5RESEQ  SGN BGOSUB DELETE
PAUSE RESTORE WHEN ?<>INDENT E
HOME NOSTALGIC LN INPUT
DEF PROC LN .CHAR LN DPOKE DATA
EWNOSTALGIC FAST EHOME
NOSTALGIC SGN BFOR GOSUB DELETE
FAST 5  SGN BGOSUB DELETE ASN E
WHEN IF EWHEN ?ASN WHEN EW
NOSTALGIC FAST EHOME NOSTALGIC
SGN BFOR GOSUB DELETE 6W
NOSTALGIC EPOP NOSTALGIC FAST 51
 SGN BGOSUB DELETE TAB KWHEN E
NOSTALGIC FAST EHOME NOSTALGIC
SGN ;6 NOSTALGIC EPOP NOSTALGIC
FAST 52 SGN BGOSUB DELETE TAB
ASN WHEN ESNOSTALGIC FAST EHOME
NOSTALGIC SGN ;6SNOSTALGIC ?
CHR$ WHEN PURCHASED)LN WHEN 1D 
LN IF DEF PROC LN .CHAR TAN ?
GOSUB WHEN NO GOLD)NEW WHEN 1E 
LN IF DEF PROC LN .CHAR TAN LN
DPOKE DATA ?4INDENT DIR?) 
INDENT 14 LN IF DEF PROC LN .
CHAR LN IF LOOP EHOME NOSTALGIC
FAST 5W SGN BGOSUB DELETE TAB P
INDENT ?DINDENT NORTH)8INDENT 15
 LN IF DEF PROC LN .CHAR EHOME
NOSTALGIC FAST 5S SGN BGOSUB
DELETE TAB WHILE INDENT ?UNDRAW
INDENT SOUTH)ERROR INDENT 15 LN
IF DEF PROC LN .CHAR EHOME
NOSTALGIC FAST 5A SGN BGOSUB
DELETE TAB ?INDENT ?ELSE INDENT
WEST)POP INDENT 14 LN IF
DEF PROC LN .CHAR EHOME
NOSTALGIC FAST 5D SGN BGOSUB
DELETE TAB ;INDENT ?$INDENT EAST
)GINDENT 14 LN IF DEF PROC LN .
CHAR EHOME NOSTALGIC FAST 5W 
SGN BGOSUB DELETE TAB EINDENT ?
NEXT INDENT EHOME NOSTALGIC
FAST 5S SGN BGOSUB DELETE TAB V
INDENT ?NEXT INDENT EHOME
NOSTALGIC FAST 5A SGN BGOSUB
DELETE TAB ATN INDENT ?NEXT
INDENT EHOME NOSTALGIC FAST 5D 
SGN BGOSUB DELETE TAB <>INDENT ?
NEXT INDENT ?NEW INDENT CANCEL)
STEP INDENT 1T LN IF DEF PROC
LN .CHAR TAN LN DPOKE DATA ?1
RESEQ NOT HERE)RAND INDENT 1A 
LN IF DEF PROC LN .CHAR TAN LN
DPOKE DATA ?1RESEQ YOU DIED*)=
RESEQ 1D LN IF DEF PROC LN .
CHAR LN DPOKE DATA ?1UNTIL 5  6
HOME NOSTALGIC 51 6ELSE
NOSTALGIC EKNOSTALGIC FAST 52 
SGN BFOR GOSUB DELETE FAST EK
NOSTALGIC FAST 52 SGN ;SGN 7
GOSUB DO 4NOSTALGIC 66NOSTALGIC
51 6?NOSTALGIC EONOSTALGIC FAST
52 SGN BFOR GOSUB DELETE FAST EO
NOSTALGIC FAST 52 SGN ;SGN 7
GOSUB DO LOOP NOSTALGIC 6UNTIL
NOSTALGIC LN ?ECURSOR NOSTALGIC
FAST 51 SGN BGOSUB DELETE TAB 0
RESEQ 57 FAST ECNOSTALGIC SGN ;6
?NOSTALGIC ECURSOR NOSTALGIC
FAST 52 SGN BGOSUB DELETE TAB K
RESEQ 5" 6?NOSTALGIC ECURSOR
NOSTALGIC FAST 57 SGN BGOSUB
DELETE TAB CODE RESEQ 5£ 6?
NOSTALGIC ECURSOR NOSTALGIC
FAST 54 SGN BGOSUB DELETE TAB **
RESEQ 5$ 6?NOSTALGIC ECURSOR
NOSTALGIC FAST 55 SGN BGOSUB
DELETE TAB GOTO RESEQ 5: 6?
NOSTALGIC ECURSOR NOSTALGIC
FAST 5T SGN BGOSUB DELETE TAB T
OFF5? FAST EGNOSTALGIC SGN ;6?
NOSTALGIC ECURSOR NOSTALGIC
FAST 5E SGN BGOSUB DELETE TAB ,
OFF5) 6?NOSTALGIC E4NOSTALGIC
FAST EKNOSTALGIC SGN BGOSUB
DELETE TAB PIOFFELOOP NOSTALGIC
FAST EONOSTALGIC SGN BGOSUB
DELETE TAB PIOFF51 FAST EG
NOSTALGIC SGN ;6?NOSTALGIC LN S
CURSOR E?NOSTALGIC FAST 51 SGN ;
6?NOSTALGIC ELOOP NOSTALGIC 76
LOOP NOSTALGIC GOSUB OFFUNTIL
NOSTALGIC BGOSUB DELETE IF ?
RESEQ EELSE NOSTALGIC FAST 51 
SGN ;6ELSE NOSTALGIC E4
NOSTALGIC 764NOSTALGIC GOSUB OFF
6NOSTALGIC BGOSUB DELETE IF
RESEQ RESEQ EGNOSTALGIC FAST 51 
SGN ;6GNOSTALGIC EGNOSTALGIC
FAST 51 SGN BGOSUB DELETE PAUSE
3OFF5  6GNOSTALGIC ECNOSTALGIC
FAST 51 SGN ;6CNOSTALGIC EC
NOSTALGIC FAST 5E SGN BGOSUB
DELETE PAUSE ZOFF5  6CNOSTALGIC
E5END PROC FAST LN RNDTRACE LN
LINE TRACE SGN LN >DRAW 6HOME
NOSTALGIC TAN 5?RND6?NOSTALGIC E
?NOSTALGIC FAST 51 SGN ;6?
NOSTALGIC E?NOSTALGIC REM  SGN B
GOSUB DELETE TAB CCURSOR E?
NOSTALGIC FAST 51 SGN ;** SGN B
GOSUB DELETE TAB CCURSOR E?
NOSTALGIC FAST 52 SGN ;£ SGN B
GOSUB DELETE TAB CCURSOR ?F
CURSOR ?NOT OFFE?NOSTALGIC FAST
57 SGN ;6?NOSTALGIC TAN E8
NOSTALGIC FAST 55 FAST EELSE
NOSTALGIC FAST 51 SGN BFOR
GOSUB DELETE SGN LN )TRACE FAST
54 SGN LN )TRACE FAST 55 
ERR MSGS EDIT LPRINT SGN ;FAST
PUSH NOSTALGIC FAST 54 ERR MSGS
EDIT LPRINT SGN ;FAST PUSH
NOSTALGIC FAST E?NOSTALGIC FAST
51 SGN BFOR GOSUB DELETE SGN LN
)TRACE FAST 51 ERR MSGS EDIT
LPRINT SGN ;FAST PUSH NOSTALGIC
SGN ;6END PROC NOSTALGIC E?
NOSTALGIC FAST E?NOSTALGIC FAST
51 SGN BFOR GOSUB DELETE FAST 5-
 SGN LN )TRACE SGN ;6?NOSTALGIC
51 FAST 54 SGN 7GOSUB DO  
NOSTALGIC 6WNOSTALGIC EEND PROC
NOSTALGIC FAST E?NOSTALGIC ?E
END PROC NOSTALGIC FAST 51 SGN ;
FAST E?NOSTALGIC FAST 51 SGN ;?E
END PROC NOSTALGIC FAST 52 SGN ;
FAST E?NOSTALGIC FAST 52 SGN ;?E
END PROC NOSTALGIC FAST 57 SGN ;
FAST E?NOSTALGIC FAST 57 SGN ;?E
END PROC NOSTALGIC FAST 55 SGN ;
6END PROC NOSTALGIC E?NOSTALGIC
FAST 54 SGN ;6?NOSTALGIC E 
NOSTALGIC 76 NOSTALGIC GOSUB OFF
WNOSTALGIC BGOSUB DELETE IF Z
CURSOR TAN 5" FAST 5= SGN 7
GOSUB DO  NOSTALGIC 6WNOSTALGIC
E8NOSTALGIC FAST 55 FAST E 
NOSTALGIC SGN LN )TRACE SGN ;6
END PROC NOSTALGIC 5- FAST 52 
SGN 7GOSUB DO RNOSTALGIC 6Y
NOSTALGIC EEND PROC NOSTALGIC
FAST ERNOSTALGIC FAST 55 
ERR MSGS EDIT LPRINT SGN ;FAST
PUSH NOSTALGIC SGN BFOR GOSUB
DELETE FAST EEND PROC NOSTALGIC
FAST ERNOSTALGIC SGN ;?ER
NOSTALGIC 76RNOSTALGIC GOSUB OFF
YNOSTALGIC BGOSUB DELETE IF ?
DATA E NOSTALGIC 76 NOSTALGIC
GOSUB OFFWNOSTALGIC BGOSUB
DELETE IF EXIT DATA 5= FAST 5- 
SGN CALL EDIT LN PRINT A?<>DATA
         )USR DATA 1D LN IF
DEF PROC 5= FAST 5- SGN CALL
EDIT LN PRINT ATAN 5< FAST 5- 
SGN CALL EDIT LN PRINT A
RESTORE BUILDING)4RESTORE 1A LN
IF DEF PROC 5= FAST 5- SGN CALL
EDIT LN PRINT A?ARESTORE >)9
RESTORE 11 LN IF DEF PROC 5
NOSTALGIC NOSTALGIC GOSUB OFF1
END PROC LN OFFDPOKE 5""2LN
UNTIL DEF PROC 5  FAST 5+ SGN 7
GOSUB DO KNOSTALGIC 6MNOSTALGIC
5  FAST 53 SGN 7GOSUB DO O
NOSTALGIC 6QNOSTALGIC EK
NOSTALGIC FAST 54 SGN LN )TRACE
FAST EONOSTALGIC FAST 51 
ERR MSGS EDIT LPRINT SGN ;FAST
PUSH NOSTALGIC SGN ;64NOSTALGIC
51 6?NOSTALGIC EKNOSTALGIC FAST
5  SGN BGOSUB DELETE TAB -
RESTORE ?VAL READ EONOSTALGIC
FAST 5  SGN BGOSUB DELETE TAB B
RESTORE ?VAL READ E4NOSTALGIC
FAST 54 SGN BFOR GOSUB DELETE
GOSUB UNDRAW NOSTALGIC
NOSTALGIC DDSTR$ LN NOSTALGIC
DPOKE FOR SGN 6HNOSTALGIC E4
NOSTALGIC FAST 51 SGN BFOR
GOSUB DELETE GOSUB UNDRAW
NOSTALGIC NOSTALGIC DDSTR$ LN
NOSTALGIC DPOKE FOR SGN 6POP
NOSTALGIC EPOP NOSTALGIC FAST 55
 SGN BGOSUB DELETE PAUSE TREAD E
4NOSTALGIC FAST 52 SGN BFOR
GOSUB DELETE GOSUB UNDRAW
NOSTALGIC NOSTALGIC DDSTR$ LN
NOSTALGIC DPOKE FOR SGN 6POP
NOSTALGIC EHNOSTALGIC FAST 55 
SGN BGOSUB DELETE PAUSE ,READ E
POP NOSTALGIC 6HNOSTALGIC 5ARND
LN PUSH DRAW FAST 5 1SGN LN
CLEAR DEF PROC 6£NOSTALGIC 5ARND
LN PUSH DRAW FAST 5 1SGN LN
CLEAR DEF PROC 6(NOSTALGIC E(
NOSTALGIC FAST 5M SGN BGOSUB
DELETE PAUSE EDIT READ ?IF READ
E£NOSTALGIC FAST 5? SGN BGOSUB
DELETE PAUSE USER READ 54 6?
NOSTALGIC E£NOSTALGIC FAST 5; 
SGN BGOSUB DELETE PAUSE ?READ 52
 6?NOSTALGIC E£NOSTALGIC FAST 5R
 SGN BGOSUB DELETE PAUSE GREAD 5
7 6?NOSTALGIC E£NOSTALGIC FAST 5
UNDRAW  SGN BGOSUB DELETE PAUSE
1READ 55 6?NOSTALGIC E£
NOSTALGIC FAST 5READ  SGN B
GOSUB DELETE PAUSE LREAD 5T 6?
NOSTALGIC E£NOSTALGIC FAST 5
USER  SGN BGOSUB DELETE PAUSE
VAL READ 5E 6?NOSTALGIC E4
NOSTALGIC GOSUB UNDRAW
NOSTALGIC NOSTALGIC DDFAST E?
NOSTALGIC SGN FOR LN OFFDPOKE EO
NOSTALGIC 76ONOSTALGIC GOSUB OFF
QNOSTALGIC BGOSUB DELETE IF
READ RESTORE EKNOSTALGIC 76K
NOSTALGIC GOSUB OFFMNOSTALGIC B
GOSUB DELETE IF DEF PROC
RESTORE TAN EHNOSTALGIC 6?
NOSTALGIC E(NOSTALGIC FAST 5
UNDRAW  SGN BGOSUB DELETE PAUSE
=NOSTALGIC EPOP NOSTALGIC 6?
NOSTALGIC ?VAL READ TAN         
* * ??          = - 7 4 HOME    
END PROC    1       ELSE        
X?  T T T   1   2?  N   1   T   
T   S   FAST ?  V?  5 5 3 3 1   
L   2   PRINT  7WHEN  REM       
MCODER II         COPYRIGHT 1983
   D C THRELFALL COMPILER AT 173
00 PROG AT 20500
  10 REM **TILES**
  20 CLS
  30 CLEAR
  40 PRINT "Q GEM QUEST ** FRACT
URED WORLD W"
  50 FOR L=1 TO 20
  60 PRINT " ";TAB 21;"         
  ";
  70 NEXT L
  80 PRINT "R                   
           E";AT 9,22;"         
"
  81 LET PP=PEEK 16396+256*PEEK
16397+1
  82 GOSUB 9000
  85 LET Q=0
  90 LET Z=0
 100 LET X=5
 110 LET Y=10
 120 LET HP=100
 121 LET GL=100
 122 LET WL=1
 123 LET GM=0
 130 LET FD=100
 145 GOSUB 3000
 146 PRINT "DONE."
 150 GOSUB 1100
 155 REM M?
 160 GOSUB 1000
 200 GOTO 150
 500 LET LL=L
 510 IF L<0 THEN LET LL=L+22
 520 IF L>21 THEN LET LL=L-22
 530 LET MM=M
 540 IF M<0 THEN LET MM=M+32
 550 IF M>31 THEN LET MM=M-32
 560 LET LOC=1+32*LL+MM
 570 LET T1=W(LOC)
 580 RETURN
1000 IF FD>0 THEN LET FD=FD-1
1002 IF FD<1 THEN LET HP=HP-1
1003 IF HP<1 THEN GOTO 1810
1005 LET L=X
1006 LET M=Y
1007 IF I=60 THEN LET L=X-1
1008 IF L<0 THEN LET L=21
1010 IF I=56 THEN LET L=X+1
1015 IF L>21 THEN LET L=0
1020 IF I=38 THEN LET M=Y-1
1025 IF M<0 THEN LET M=31
1030 IF I=41 THEN LET M=Y+1
1032 IF M>31 THEN LET M=0
1035 GOSUB 500
1040 IF T1=1 THEN GOTO 1095
1041 IF T1=5 THEN GOTO 1095
1050 LET X=L
1051 LET Y=M
1060 IF I=60 THEN PRINT "NORTH"
1061 IF I=60 THEN RETURN
1062 IF I=56 THEN PRINT "SOUTH"
1063 IF I=56 THEN RETURN
1064 IF I=38 THEN PRINT "WEST"
1065 IF I=38 THEN RETURN
1066 IF I=41 THEN PRINT "EAST"
1067 IF I=41 THEN RETURN
1068 IF I=45 THEN PRINT "HIT"
1069 IF I=45 THEN GOTO 1500
1078 IF I=54 THEN PRINT "QUIT"
1079 IF I=54 THEN GOTO 1200
1080 IF I=42 THEN PRINT "ENTER"
1081 IF I=42 THEN GOTO 1400
1089 PRINT "ZZZ"
1090 RETURN
1095 PRINT "NO MOVE"
1096 RETURN
1100 PRINT AT 2,22;"GOLD:";GL;" 
";AT 3,22;"HLTH:";HP;" ";AT 4,22
;"FOOD:";FD;" ";AT 6,22;"WORLD: 
";WL;AT 7,22;"GEMS:  ";GM
1105 GOSUB 6000
1110 PRINT ">";
1120 GOSUB 2000
1130 IF I>0 THEN RETURN
1140 GOTO 1120
1200 GOSUB 6000
1210 PRINT "START"
1220 GOSUB 6000
1230 PRINT "OVER? Y/N"
1250 GOSUB 1100
1260 IF I=51 THEN PRINT "NO";
1270 IF I=62 THEN PRINT "YES";
1280 IF I=51 THEN LET L=USR 3292
1290 IF I<>62 THEN GOTO 1250
1300 GOSUB 6000
1310 PRINT "OKAY..."
1320 GOSUB 6000
1330 GOSUB 6000
1340 GOSUB 6000
1350 GOSUB 6000
1360 GOTO 82
1400 GOSUB 6000
1420 IF T1=6 THEN GOTO 1460
1430 IF T1=7 THEN PRINT "DUNGEON
"
1440 IF T1<6 THEN PRINT "NOT HER
E"
1450 RETURN
1460 PRINT "CITY"
1461 GOSUB 6000
1462 PRINT "FOOD OR"
1463 GOSUB 6000
1465 PRINT "HEALTH?"
1466 GOSUB 1100
1467 LET E=0
1468 IF I=43 THEN LET E=1
1469 IF I=43 THEN PRINT "FOOD"
1470 IF I=45 THEN LET E=2
1471 IF I=45 THEN PRINT "HEALTH"
1472 IF E=0 THEN GOTO 1650
1473 GOSUB 6000
1474 PRINT "HOW MANY?"
1475 GOSUB 6000
1476 PRINT "1-9 X10"
1477 GOSUB 1100
1478 LET I=(I-28)*10
1479 IF I<10 THEN GOTO 1650
1480 IF I>90 THEN GOTO 1650
1481 PRINT I
1482 GOSUB 6000
1484 IF GL-I<0 THEN GOTO 1489
1485 LET GL=GL-I
1486 IF E=1 THEN LET FD=FD+I
1487 IF E=2 THEN LET HP=HP+I
1496 PRINT "PURCHASED"
1497 RETURN
1498 PRINT "NO GOLD"
1499 RETURN
1500 GOSUB 6000
1510 PRINT "DIR?"
1520 GOSUB 1100
1550 IF I=60 THEN PRINT "NORTH"
1560 IF I=56 THEN PRINT "SOUTH"
1570 IF I=38 THEN PRINT "WEST"
1580 IF I=41 THEN PRINT "EAST"
1590 IF I=60 THEN GOTO 1700
1600 IF I=56 THEN GOTO 1700
1610 IF I=38 THEN GOTO 1700
1620 IF I=41 THEN GOTO 1700
1650 PRINT "CANCEL"
1660 RETURN
1700 GOSUB 6000
1710 PRINT "NOT HERE"
1720 RETURN
1800 GOSUB 6000
1810 PRINT "YOU DIED*"
1820 GOSUB 6000
1830 GOTO 1200
2000 LET I=0
2002 LET X1=1
2005 FOR L=X-2 TO X+2
2010 LET Y1=1
2020 FOR M=Y-2 TO Y+2
2090 GOSUB 500
2120 IF T1=1 THEN LET O=3+Q
2130 IF T1=2 THEN LET O=11
2131 IF T1=3 THEN LET O=12
2132 IF T1=4 THEN LET O=13
2133 IF T1=5 THEN LET O=14
2134 IF T1=6 THEN LET O=15+Z
2135 IF T1=7 THEN LET O=17
2137 IF L=X AND M=Y THEN LET O=1
+Z
2140 GOSUB 5000
2150 LET Y1=Y1+1
2160 NEXT M
2170 LET X1=X1+1
2180 NEXT L
2190 LET Z=Z+1
2200 IF Z>1 THEN LET Z=0
2210 LET Q=Q+1
2220 IF Q>7 THEN LET Q=0
2230 LET I=CODE INKEY$
2240 RETURN
2900 REM **CREATE TILES**
3000 LET T=16509
3010 LET T=T+1
3020 IF PEEK T=234 AND PEEK (T+1
)=216 AND PEEK (T+2)=12 THEN
GOTO 3040
3030 GOTO 3010
3040 LET T=T+3
3050 RETURN
5000 LET MM=PP+33*(X1-1)*4+33+4*
(Y1-1)+1
5010 LET NN=T+(O-1)*22
5020 FOR C=1 TO 4
5030 POKE MM,PEEK NN
5040 POKE MM+1,PEEK (NN+1)
5050 POKE MM+2,PEEK (NN+2)
5060 POKE MM+3,PEEK (NN+3)
5070 LET MM=MM+33
5080 LET NN=NN+4
5090 NEXT C
5100 RETURN
6000 FOR C=11 TO 20
6020 LET MM=PP+33*C
6030 FOR D=22 TO 30
6040 POKE MM+D-33,PEEK (MM+D)
6050 NEXT D
6060 NEXT C
6080 PRINT AT 20,22;"         ";
AT 20,22;
6090 RETURN
9000 PRINT AT 19,22;"BUILDING";
AT 20,22;">";
9010 DIM W(704)
9020 FOR X=0 TO 21
9030 FOR Y=0 TO 31
9040 LET L=X*32+Y+1
9050 LET T=1
9060 IF X=0 THEN GOTO 9200
9070 IF Y=0 THEN GOTO 9200
9080 LET N=W(L-32)
9090 LET E=W(L-1)
9100 IF E>5 THEN LET E=W(L-2)
9110 IF N>5 THEN LET N=E
9120 LET R=USR 16550/328
9125 LET S=USR 16550/328
9130 IF S>50 THEN GOTO 9270
9140 IF R>15 THEN LET T=4
9150 IF R>25 THEN LET T=2
9160 IF R>55 THEN LET T=3
9170 IF R>75 THEN LET T=5
9180 IF R>95 THEN LET T=6
9190 IF R>97 THEN LET T=7
9200 LET W(L)=T
9220 NEXT Y
9240 NEXT X
9260 RETURN
9270 LET T=N
9280 IF S>75 THEN LET T=E
9290 GOTO 9200
9299 STOP
9310 REM **£8YE 8WQ48Y2 2 1 
9320 REM 8Y8 8WR18Y  2 1 
9330 REM E4  12YT  E4YT12
9340 REM 6    767  6 67 7
9350 REM 4  E2YT1 E4 T12Y
9360 REM    6767  6  7 76
9370 REM   E4YT12E4  12YT
9380 REM   6 67 76    767
9390 REM  E4 T12Y4  E2YT1
9400 REM  6  7 76   6767 
9410 REM EE   144442 2   
9420 REM  Q  E 5 Q    G  
9430 REM SDSDDSDSSDSDDSDS
9440 REM  T44T T2 T 4T2T2
9450 REM  8D 8QW58::52121
9460 REM  8S 8QW58::52121
9470 REM E  4 DS  DS  DS 
9500 SAVE "GQ2016"
9510 RAND USR 20500