ZX81 Programs


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

ZX81 Program Listing

tiles32 (tiles32.p)


SYSTEM VARIABLES

PROG  : 16509
D-FILE: 30776
VARS  : 31569
E-LINE: 31570
STKBOT: 31570
STKEND: 31570


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 ?7RNDA"  Q"
30518 
   2 REM
30241 :1LN ATN DEF PROC LN ES5
CLEAR USER :1LN ATN DEF PROC ?
DRAW END PROC Q                 
             W)EEND PROC 1LN
IF DEF PROC LN .CHAR 51 FAST 5= 
SGN 7GOSUB DO 5*6E*?GEND PROC  A
AAAHHHHAAAAHHHHAAAA           )
PUSH END PROC 1LN IF DEF PROC
E5*765*GOSUB OFFE*BGOSUB DELETE
IF DPEEK END PROC ?LEN END PROC
R                              E
)AEND PROC 1LN IF DEF PROC 5£
RND 1FAST 5$RND)TRACE FAST 51 
ERR MSGS EDIT LPRINT SGN ;FAST
PUSH NOSTALGIC SGN ;6D*LN FOR
RESTORE 5  6$*5  6)*55 6+*5S 6;*
E+*61*E;*65*LN CINDENT 5  69*LN
1WHILE E5END PROC FAST LN RND
TRACE LN LINE TRACE SGN LN >
DRAW 69*E9*FAST 5  SGN BGOSUB
DELETE ASN PROTECT LN 2DELETE ?5
E5*6D*E5*FAST 5  SGN BGOSUB
DELETE ASN ?IF ?E5*FAST 5- SGN ;
6D*E5*FAST 5+ SGN BGOSUB DELETE
PAUSE ?E5*FAST 5- SGN BFOR
GOSUB DELETE 6D*EL*6H*EL*FAST
 SGN BGOSUB DELETE ASN MIF MEL*
FAST 54 SGN ;6H*EL*FAST 53 SGN B
GOSUB DELETE PAUSE INT EL*FAST 5
SGN BFOR GOSUB DELETE 6H*51 
FAST 54 FAST ED*SGN LN )TRACE
FAST EH*ERR MSGS EDIT LPRINT
SGN ;FAST PUSH NOSTALGIC SGN ;6P
*EP*GOSUB UNDRAW X*DDSTR$ LN
NOSTALGIC DPOKE FOR SGN 6T*TAN E
+*65*E;*6L*E9*FAST 5W SGN B
GOSUB DELETE TAB FDELETE E+*
FAST 51 SGN BFOR GOSUB DELETE 65
*E5*FAST 5  SGN BGOSUB DELETE
ASN PIDELETE IF PIDELETE 5+ 65*E
9*FAST 5S SGN BGOSUB DELETE TAB
CURSOR DELETE E+*FAST 51 SGN ;65
*E5*FAST 5+ SGN BGOSUB DELETE
PAUSE ?DELETE 5  65*E9*FAST 5A 
SGN BGOSUB DELETE TAB $DELETE E;
*FAST 51 SGN BFOR GOSUB DELETE 6
L*EL*FAST 5  SGN BGOSUB DELETE
ASN 8DELETE IF 8DELETE 53 6L*E9*
FAST 5D SGN BGOSUB DELETE TAB Y
DELETE E;*FAST 51 SGN ;6L*EL*
FAST 53 SGN BGOSUB DELETE PAUSE
ABS DELETE 5  6L*LN DEF PROC ET*
FAST 51 SGN BGOSUB DELETE TAB
SLOW DELETE TAN ET*FAST 55 SGN B
GOSUB DELETE TAB NEXT DELETE
TAN E5*6+*EL*6;*LN TRACE
RESTORE 5= FAST 5- SGN CALL
EDIT LN PRINT A?<DO >)>DO 11 LN
IF DEF PROC E9*FAST 5W SGN B
GOSUB DELETE TAB VDO ?MDO NORTH)
HDO 15 LN IF DEF PROC E9*FAST 5S
 SGN BGOSUB DELETE TAB RESEQ DO
?DO SOUTH)PROTECT DO 15 LN IF
DEF PROC E9*FAST 5A SGN BGOSUB
DELETE TAB ?DO ??DO WEST)DUP DO
14 LN IF DEF PROC E9*FAST 5D 
SGN BGOSUB DELETE TAB -DO ?$DO E
AST)GDO 14 LN IF DEF PROC E9*
FAST 5E SGN BGOSUB DELETE TAB P
DO ?GDO ENTER)BDO 15 LN IF
DEF PROC E9*FAST 5O SGN BGOSUB
DELETE TAB PEEK DO ?ASN DO OPEN)
LEN DO 14 LN IF DEF PROC E9*
FAST 5H SGN BGOSUB DELETE TAB
LIST DO ?SCROLL DO HIT)SLOW DO 1
7 LN IF DEF PROC E9*FAST 5B SGN
BGOSUB DELETE TAB $LOOP ?4LOOP B
UY)1LOOP 17 LN IF DEF PROC E9*
FAST 5C SGN BGOSUB DELETE TAB F
LOOP ?6LOOP CAST)2LOOP 14 LN IF
DEF PROC E9*FAST 5Y SGN BGOSUB
DELETE TAB TRACE LOOP ?RNDLOOP Y
ELL)WLOOP 14 LN IF DEF PROC E9*
FAST 5Z SGN BGOSUB DELETE TAB
DPEEK LOOP ?DATA LOOP ZZZ)RESEQ
LOOP 17 LN IF DEF PROC E9*FAST 5
SGN BGOSUB DELETE TAB RLOOP ??
LOOP QUIT)?LOOP 14 LN IF
DEF PROC E9*FAST 5Q SGN BGOSUB
DELETE TAB +LOOP ?FOR LOOP E9*
FAST 5E SGN BGOSUB DELETE TAB A
LOOP ?LN EXIT E9*FAST 5O SGN B
GOSUB DELETE TAB RLOOP ?PIUNTIL
E9*FAST 5H SGN BGOSUB DELETE
TAB COS LOOP ?PIUNTIL E9*FAST 5C
 SGN BGOSUB DELETE TAB OR LOOP
?PIUNTIL E9*FAST 5B SGN BGOSUB
DELETE TAB REM LOOP ?PIUNTIL
TAN LN TRACE RESTORE 5= FAST 5- 
SGN CALL EDIT LN PRINT A?7EXIT S
TART)RETURN LOOP 15 LN IF
DEF PROC LN TRACE RESTORE LN 1
WHILE 5= FAST 5- SGN CALL EDIT
LN PRINT A?CEXIT OVER? )6EXIT 1T
 LN IF DEF PROC E5END PROC FAST
LN RNDTRACE LN LINE TRACE SGN
LN >DRAW 69*E9*FAST 5N SGN B
GOSUB DELETE TAB RESTORE EXIT ?
EXIT EXIT NO)DO EXIT 12 LN IF
DEF PROC E9*FAST 5Y SGN BGOSUB
DELETE TAB ?EXIT ??EXIT YES)?
EXIT 17 LN IF DEF PROC E9*FAST 5
SGN BGOSUB DELETE TAB FEXIT
TAN E9*FAST 5Y SGN BGOSUB
DELETE ASN .EXIT ??EXIT LN
TRACE RESTORE 5= FAST 5- SGN
CALL EDIT LN PRINT A?PEXIT OKAY.
..)IEXIT 1E LN IF DEF PROC LN
TRACE RESTORE LN TRACE RESTORE
LN TRACE RESTORE LN TRACE
RESTORE ?RUN END PROC LN TRACE
RESTORE 5= FAST 5- SGN CALL
EDIT LN PRINT AET*FAST 5T SGN B
GOSUB DELETE TAB CLS EXIT ?
PAUSE EXIT CITY)INPUT EXIT 14 
LN IF DEF PROC ET*FAST 5E SGN B
GOSUB DELETE TAB 0UNTIL ?<UNTIL
DUNGEON)£UNTIL 1E LN IF
DEF PROC ET*FAST 5T SGN BGOSUB
DELETE ASN INKEY$UNTIL IF INKEY$
UNTIL ?SUNTIL NOT HERE)KUNTIL 1A
 LN IF DEF PROC TAN LN TRACE
RESTORE 5= FAST 5- SGN CALL
EDIT LN PRINT A?INDENT UNTIL DIR
?)EXIT UNTIL 14 LN IF DEF PROC
LN TRACE RESTORE LN 1WHILE 5= 
FAST 5- SGN CALL EDIT LN PRINT A
??UNTIL >)?UNTIL 11 LN IF
DEF PROC E5END PROC FAST LN RND
TRACE LN LINE TRACE SGN LN >
DRAW 69*E9*FAST 5W SGN BGOSUB
DELETE TAB MUNTIL ?DUNTIL NORTH)
8UNTIL 15 LN IF DEF PROC E9*
FAST 5S SGN BGOSUB DELETE TAB
SGN UNTIL ?COS UNTIL SOUTH)?
UNTIL 15 LN IF DEF PROC E9*FAST
5A SGN BGOSUB DELETE TAB LOAD
UNTIL ?NEW UNTIL WEST)LLIST
UNTIL 14 LN IF DEF PROC E9*FAST
5D SGN BGOSUB DELETE TAB $WHILE
?4WHILE EAST) WHILE 14 LN IF
DEF PROC E9*FAST 5W SGN BGOSUB
DELETE TAB 2WHILE ??WHILE E9*
FAST 5S SGN BGOSUB DELETE TAB J
WHILE ??WHILE E9*FAST 5A SGN B
GOSUB DELETE TAB RNDWHILE ??
WHILE E9*FAST 5D SGN BGOSUB
DELETE TAB WHILE ??WHILE LN 1
WHILE E9*FAST 5  SGN BGOSUB
DELETE TAB BREAK WHILE ?BREAK
UNTIL ??WHILE CANCEL)POP WHILE 1
T LN IF DEF PROC TAN LN TRACE
RESTORE 5= FAST 5- SGN CALL
EDIT LN PRINT A?<WHILE NOT HERE)
"WHILE 1A LN IF DEF PROC TAN 51 
6INKEY$*E+*FAST 52 SGN BFOR
GOSUB DELETE FAST E+*FAST 52 
SGN ;SGN 7GOSUB DO 5*6E*51 6
DPOKE *E;*FAST 52 SGN BFOR
GOSUB DELETE FAST E;*FAST 52 
SGN ;SGN 7GOSUB DO L*6N*LN
DEF PROC ET*FAST 51 SGN BGOSUB
DELETE TAB 4WHEN 57 FAST E$*SGN
;6TRACE *ET*FAST 52 SGN BGOSUB
DELETE TAB /WHEN 5" 6TRACE *ET*
FAST 57 SGN BGOSUB DELETE TAB G
WHEN 5£ 6TRACE *ET*FAST 54 SGN B
GOSUB DELETE TAB RNDWHEN 5$ 6
TRACE *ET*FAST 55 SGN BGOSUB
DELETE TAB LOOP WHEN 5: 6TRACE *
ET*FAST 5T SGN BGOSUB DELETE
TAB ?WHEN 5? FAST E)*SGN ;6
TRACE *ET*FAST 5E SGN BGOSUB
DELETE TAB WWHEN 5) 6TRACE *E5*
FAST E+*SGN BGOSUB DELETE TAB E
WHEN EL*FAST E;*SGN BGOSUB
DELETE TAB EWHEN 51 FAST E)*SGN
;6TRACE *LN 0DATA EDPOKE *FAST 5
1 SGN ;6DPOKE *EL*76L*GOSUB OFFN
*BGOSUB DELETE IF SCROLL WHILE E
INKEY$*FAST 51 SGN ;6INKEY$*E5*7
65*GOSUB OFFE*BGOSUB DELETE IF
TAB WHILE E)*FAST 51 SGN ;6)*E)*
FAST 51 SGN BGOSUB DELETE PAUSE
EINDENT 5  6)*E$*FAST 51 SGN ;6$
*E$*FAST 5E SGN BGOSUB DELETE
PAUSE BINDENT 5  6$*TAN 5EDIT *
GOSUB OFF1END PROC LN OFFDPOKE 5
FAST 5) SGN LN )TRACE LN
UNTIL DEF PROC 51 6TRACE *5*LN
SAVE CHAR LN NOSTALGIC TRACE ?*
INDENT 8YE 8WQ48Y2 2 1 )DELETE
INDENT 1LN LINE TRACE 5*LN ?
TRACE LN PCURSOR 52 6TRACE *5*
LN SAVE CHAR LN NOSTALGIC TRACE
?-INDENT 8Y8 8WR18Y  2 1 )Y
INDENT 1LN LINE TRACE 5*LN ?
TRACE LN PCURSOR 57 6TRACE *5*
LN SAVE CHAR LN NOSTALGIC TRACE
?ASN INDENT E4  12YT  E4YT12)U
INDENT 1LN LINE TRACE 5*LN ?
TRACE LN PCURSOR 54 6TRACE *5*
LN SAVE CHAR LN NOSTALGIC TRACE
?RETURN INDENT 6    767  6 67 7)
INPUT INDENT 1LN LINE TRACE 5*
LN ?TRACE LN PCURSOR 55 6TRACE *
5*LN SAVE CHAR LN NOSTALGIC
TRACE ?MRESEQ 4  E2YT1 E4 T12Y)6
RESEQ 1LN LINE TRACE 5*LN ?
TRACE LN PCURSOR 5T 6TRACE *5*
LN SAVE CHAR LN NOSTALGIC TRACE
?DPEEK RESEQ    6767  6  7 76)
UNTIL RESEQ 1LN LINE TRACE 5*
LN ?TRACE LN PCURSOR 5E 6TRACE *
5*LN SAVE CHAR LN NOSTALGIC
TRACE ?,RESEQ   E4YT12E4  12YT)F
RESEQ 1LN LINE TRACE 5*LN ?
TRACE LN PCURSOR 5A 6TRACE *5*
LN SAVE CHAR LN NOSTALGIC TRACE
?EXP RESEQ   6 67 76    767)Y
RESEQ 1LN LINE TRACE 5*LN ?
TRACE LN PCURSOR 5D 6TRACE *5*
LN SAVE CHAR LN NOSTALGIC TRACE
?2OFF E4 T12Y4  E2YT1)PAUSE
RESEQ 1LN LINE TRACE 5*LN ?
TRACE LN PCURSOR 5S 6TRACE *5*
LN SAVE CHAR LN NOSTALGIC TRACE
?QOFF 6  7 76   6767 )AOFF1LN
LINE TRACE 5*LN ?TRACE LN P
CURSOR 5" 6TRACE *5*LN SAVE
CHAR LN NOSTALGIC TRACE ?
CLR STACK OFFEE   144442 2   )
RESEQ OFF1LN LINE TRACE 5*LN ?
TRACE LN PCURSOR 5£ 6TRACE *5*
LN SAVE CHAR LN NOSTALGIC TRACE
?2OFF Q  E 5 Q    G  ):OFF1LN
LINE TRACE 5*LN ?TRACE LN P
CURSOR 5$ 6TRACE *5*LN SAVE
CHAR LN NOSTALGIC TRACE ?ABS OFF
SDSDDSDSSDSDDSDS)TAB OFF1LN
LINE TRACE 5*LN ?TRACE LN P
CURSOR 5: 6TRACE *5*LN SAVE
CHAR LN NOSTALGIC TRACE ?T
CURSOR  T44T T2 T 4T2T2)PLOT OFF
1LN LINE TRACE 5*LN ?TRACE LN
PCURSOR 5? 6TRACE *5*LN SAVE
CHAR LN NOSTALGIC TRACE ?U
CURSOR  8D 8QW58::52121)ECURSOR
1LN LINE TRACE 5*LN ?TRACE LN
PCURSOR 5( 6TRACE *5*LN SAVE
CHAR LN NOSTALGIC TRACE ??
CURSOR  8S 8QW58::52121)RESTORE
CURSOR 1LN LINE TRACE 5*LN ?
TRACE LN PCURSOR 5) 6TRACE *5*
LN SAVE CHAR LN NOSTALGIC TRACE
?6CURSOR E  4 DS  DS  DS )>
CURSOR 1LN LINE TRACE 5*LN ?
TRACE LN PCURSOR TAN 51 FAST 5( 
SGN 7GOSUB DO 5*67*5( FAST E
TRACE *FAST 51 SGN BFOR GOSUB
DELETE SGN LN )TRACE FAST E5*
SGN ;GOSUB UNDRAW EDIT *DDFAST E
5END PROC FAST 5*LN SAVE CHAR E5
*DATA LOOP LN AUTO TRACE 5*LN
WHILE TRACE LN LINE TRACE SGN
LN >DRAW SGN FOR LN OFFDPOKE E5*
765*GOSUB OFF7*BGOSUB DELETE IF
VAL CURSOR TAN ED*FAST 55 FAST E
INKEY$*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 EDPOKE *FAST 51 SGN BFOR
GOSUB DELETE SGN LN )TRACE FAST
51 ERR MSGS EDIT LPRINT SGN ;
FAST PUSH NOSTALGIC SGN ;6H*5( 
FAST ETRACE *FAST 51 SGN BFOR
GOSUB DELETE SGN LN )TRACE FAST
51 SGN ;6EXIT *51 FAST 54 SGN 7
GOSUB DO INDENT *6OFF*EH*FAST E
EXIT *GOSUB UNDRAW EDIT *DDSTR$
LN NOSTALGIC DPOKE FOR SGN SGN
FOR ?EH*FAST 51 SGN ;FAST EEXIT
*FAST 51 SGN ;GOSUB UNDRAW EDIT
*DDSTR$ LN NOSTALGIC DPOKE FOR
SGN SGN FOR ?EH*FAST 52 SGN ;
FAST EEXIT *FAST 52 SGN ;GOSUB
UNDRAW EDIT *DDSTR$ LN
NOSTALGIC DPOKE FOR SGN SGN FOR
?EH*FAST 57 SGN ;FAST EEXIT *
FAST 57 SGN ;GOSUB UNDRAW EDIT *
DDSTR$ LN NOSTALGIC DPOKE FOR
SGN SGN FOR ?EH*FAST 55 SGN ;6H*
EEXIT *FAST 54 SGN ;6EXIT *E
INDENT *76INDENT *GOSUB OFFOFF*B
GOSUB DELETE IF 7DATA TAN 52 
FAST 5= SGN 7GOSUB DO INDENT *6
OFF*ED*FAST 55 FAST EINDENT *
SGN LN )TRACE SGN ;6H*5- FAST 52
 SGN 7GOSUB DO DATA *6READ *EH*
FAST EDATA *FAST 55 ERR MSGS
EDIT LPRINT SGN ;FAST PUSH
NOSTALGIC SGN BFOR GOSUB DELETE
FAST EH*FAST EDATA *SGN ;?EDATA
*76DATA *GOSUB OFFREAD *BGOSUB
DELETE IF ?RESTORE EINDENT *76
INDENT *GOSUB OFFOFF*BGOSUB
DELETE IF INDENT RESTORE 5= 
FAST 5- SGN CALL EDIT LN PRINT A
?LPRINT RESTORE          )**
RESTORE 1D LN IF DEF PROC TAN 5>
 FAST 5- SGN CALL EDIT LN PRINT
A?7READ CREATING)CLS RESTORE 1A 
LN IF DEF PROC 5< FAST 5- SGN
CALL EDIT LN PRINT A?8READ WORLD
...)0READ 1A LN IF DEF PROC 5  6
)*5X*GOSUB OFF1END PROC LN OFF
DPOKE 5""2LN UNTIL DEF PROC 5  
FAST 5+ SGN 7GOSUB DO +*6**E)*
FAST 5  SGN BGOSUB DELETE TAB ?
READ 5= FAST 5- SGN CALL EDIT
LN PRINT A??READ 1)?READ 11 LN
IF DEF PROC E)*FAST 51 SGN B
GOSUB DELETE TAB 7READ 5= FAST 5
SGN CALL EDIT LN PRINT A?,
READ 2);READ 11 LN IF DEF PROC E
)*FAST 52 SGN BGOSUB DELETE TAB
ACS READ 5= FAST 5- SGN CALL
EDIT LN PRINT A?TAB READ E)AT
READ 11 LN IF DEF PROC E)*FAST 5
7 SGN BGOSUB DELETE TAB NEXT
READ 5= FAST 5- SGN CALL EDIT
LN PRINT A?REM READ 4)DIM READ 1
1 LN IF DEF PROC E)*FAST 51 SGN
;6)*E)*FAST 57 SGN BGOSUB
DELETE PAUSE <NOSTALGIC 5  6)*5 
 FAST 53 SGN 7GOSUB DO ;*6.*E+*
FAST 54 SGN LN )TRACE FAST E;*
FAST 51 ERR MSGS EDIT LPRINT
SGN ;FAST PUSH NOSTALGIC SGN ;65
*51 6USER *E+*FAST 5  SGN B
GOSUB DELETE TAB RESEQ
NOSTALGIC ?GUSER E;*FAST 5  SGN
BGOSUB DELETE TAB DUP NOSTALGIC
?GUSER E5*FAST 54 SGN BFOR
GOSUB DELETE GOSUB UNDRAW X*DD
STR$ LN NOSTALGIC DPOKE FOR SGN
6BREAK *E5*FAST 51 SGN BFOR
GOSUB DELETE GOSUB UNDRAW X*DD
STR$ LN NOSTALGIC DPOKE FOR SGN
6PUSH *EPUSH *FAST 55 SGN B
GOSUB DELETE PAUSE ASN
NOSTALGIC E5*FAST 52 SGN BFOR
GOSUB DELETE GOSUB UNDRAW X*DD
STR$ LN NOSTALGIC DPOKE FOR SGN
6PUSH *EBREAK *FAST 55 SGN B
GOSUB DELETE PAUSE THEN
NOSTALGIC EPUSH *6BREAK *5ARND
LN PUSH DRAW FAST 5 1SGN LN
CLEAR DEF PROC 6END WHEN *5ARND
LN PUSH DRAW FAST 5 1SGN LN
CLEAR DEF PROC 6?*E?*FAST 5M 
SGN BGOSUB DELETE PAUSE )USER ?
TO USER EEND WHEN *FAST 5? SGN
BGOSUB DELETE PAUSE 9USER 54 6
USER *EEND WHEN *FAST 5; SGN B
GOSUB DELETE PAUSE TUSER 52 6
USER *EEND WHEN *FAST 5R SGN B
GOSUB DELETE PAUSE EDIT USER 57 
6USER *EEND WHEN *FAST 5UNDRAW  
SGN BGOSUB DELETE PAUSE USER
USER 55 6USER *EEND WHEN *FAST 5
READ  SGN BGOSUB DELETE PAUSE ?
USER 5T 6USER *EEND WHEN *FAST 5
USER  SGN BGOSUB DELETE PAUSE G
USER 5E 6USER *E5*GOSUB UNDRAW X
*DDFAST EUSER *SGN FOR LN OFF
DPOKE E;*76;*GOSUB OFF.*BGOSUB
DELETE IF 7NOSTALGIC E+*76+*
GOSUB OFF**BGOSUB DELETE IF DO
READ 5= FAST 5- SGN CALL EDIT
LN PRINT A?ABS USER DONE.)LN
USER 15 LN IF DEF PROC LN TRACE
RESTORE TAN EBREAK *6USER *E?*
FAST 5UNDRAW  SGN BGOSUB DELETE
PAUSE RAND USER EPUSH *6USER *?G
USER TAN         A A T?  E   1  
 5 - S 4 5   ) )     E   COPY
 $ $ GOSUB    1     T   D   2G  
RESTORE 6)   5 5 3 3 5   2   1
   WHILE    "     7WHEN  REM    
   MCODER II         COPYRIGHT 1
983   D C THRELFALL COMPILER AT 
17300 PROG AT 20500
  10 REM **TILES**
  20 CLS
  30 CLEAR
  40 PRINT "Q                   
           W"
  50 FOR L=1 TO 20
  60 PRINT " AAAAHHHHAAAAHHHHAAA
A           ";
  70 NEXT L
  80 PRINT "R                   
           E";
  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 A=X
 130 LET B=Y
 145 GOSUB 3000
 150 LET I=0
 152 GOSUB 2000
 155 REM MOVE?
 156 LET I=CODE INKEY$
 160 IF I<>0 THEN 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 LET L=X
1002 LET M=Y
1005 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 RETURN
1041 IF T1=5 THEN RETURN
1050 LET X=L
1051 LET Y=M
1060 GOSUB 6000
1061 PRINT AT 20,22;">";
1062 IF I=60 THEN PRINT "NORTH";
1063 IF I=56 THEN PRINT "SOUTH";
1064 IF I=38 THEN PRINT "WEST";
1065 IF I=41 THEN PRINT "EAST";
1066 IF I=42 THEN PRINT "ENTER";
1067 IF I=52 THEN PRINT "OPEN";
1068 IF I=45 THEN PRINT "HIT";
1069 IF I=39 THEN PRINT "BUY";
1070 IF I=40 THEN PRINT "CAST";
1071 IF I=62 THEN PRINT "YELL";
1072 IF I=63 THEN PRINT "ZZZ";
1073 IF I=54 THEN PRINT "QUIT";
1080 IF I=54 THEN GOTO 1200
1081 IF I=42 THEN GOTO 1400
1082 IF I=52 THEN GOTO 1500
1083 IF I=45 THEN GOTO 1500
1084 IF I=40 THEN GOTO 1500
1085 IF I=39 THEN GOTO 1500
1100 RETURN
1200 GOSUB 6000
1210 PRINT AT 20,22;"START";
1220 GOSUB 6000
1225 GOSUB 2000
1230 PRINT AT 20,22;"OVER? ";
1250 LET I=CODE INKEY$
1260 IF I=51 THEN PRINT "NO";
1270 IF I=62 THEN PRINT "YES";
1280 IF I=51 THEN RETURN
1290 IF I<>62 THEN GOTO 1225
1300 GOSUB 6000
1310 PRINT AT 20,22;"OKAY...";
1320 GOSUB 6000
1330 GOSUB 6000
1340 GOSUB 6000
1350 GOSUB 6000
1360 GOTO 82
1400 GOSUB 6000
1410 PRINT AT 20,22;
1420 IF T1=6 THEN PRINT "CITY";
1430 IF T1=7 THEN PRINT "DUNGEON
";
1440 IF T1<6 THEN PRINT "NOT HER
E";
1450 RETURN
1500 GOSUB 6000
1510 PRINT AT 20,22;"DIR?";
1520 GOSUB 6000
1525 GOSUB 2000
1530 PRINT AT 20,22;">";
1540 LET I=CODE INKEY$
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
1630 GOSUB 2000
1640 IF I=0 THEN GOTO 1525
1650 PRINT "CANCEL";
1660 RETURN
1700 GOSUB 6000
1710 PRINT AT 20,22;"NOT HERE";
1720 RETURN
2000 LET X1=1
2005 FOR L=X-2 TO X+2
2010 LET Y1=1
2020 FOR M=Y-2 TO Y+2
2030 REM LET IN=CODE INKEY$
2040 REM IF IN>0 THEN LET I=IN
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 RETURN
2900 REM **CREATE TILES**
3000 DIM T(16*17)
3010 LET O=1
3020 LET A$="8YE 8WQ48Y2 2 1 "
3030 GOSUB 4000
3040 LET O=2
3050 LET A$="8Y8 8WR18Y  2 1 "
3060 GOSUB 4000
3070 LET O=3
3071 LET A$="E4  12YT  E4YT12"
3072 GOSUB 4000
3073 LET O=4
3074 LET A$="6    767  6 67 7"
3075 GOSUB 4000
3076 LET O=5
3077 LET A$="4  E2YT1 E4 T12Y"
3078 GOSUB 4000
3079 LET O=6
3080 LET A$="   6767  6  7 76"
3081 GOSUB 4000
3082 LET O=7
3083 LET A$="  E4YT12E4  12YT"
3084 GOSUB 4000
3085 LET O=8
3086 LET A$="  6 67 76    767"
3087 GOSUB 4000
3088 LET O=9
3089 LET A$=" E4 T12Y4  E2YT1"
3090 GOSUB 4000
3091 LET O=10
3092 LET A$=" 6  7 76   6767 "
3093 GOSUB 4000
3200 LET O=11
3210 LET A$="EE   144442 2   "
3220 GOSUB 4000
3300 LET O=12
3310 LET A$=" Q  E 5 Q    G  "
3320 GOSUB 4000
3400 LET O=13
3410 LET A$="SDSDDSDSSDSDDSDS"
3420 GOSUB 4000
3500 LET O=14
3510 LET A$=" T44T T2 T 4T2T2"
3520 GOSUB 4000
3600 LET O=15
3610 LET A$=" 8D 8QW58::52121"
3620 GOSUB 4000
3630 LET O=16
3640 LET A$=" 8S 8QW58::52121"
3650 GOSUB 4000
3700 LET O=17
3710 LET A$="E  4 DS  DS  DS "
3720 GOSUB 4000
3730 RETURN
4000 FOR B=1 TO 16
4010 LET T(16*(O-1)+B)=CODE A$(B
)
4020 NEXT B
4030 RETURN
5000 LET MM=PP+33*(X1-1)*4+33+4*
(Y1-1)+1
5010 LET NN=16*(O-1)+1
5020 FOR C=1 TO 4
5030 POKE MM,T(NN)
5040 POKE MM+1,T(NN+1)
5050 POKE MM+2,T(NN+2)
5060 POKE MM+3,T(NN+3)
5070 LET MM=MM+33
5080 LET NN=NN+4
5090 NEXT C
5100 RETURN
6000 REM **SCROLL**
6010 FOR C=2 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;"         ";
6090 RETURN
9000 REM **CREATE WORLD**
9001 PRINT AT 18,22;"CREATING";
AT 19,22;"WORLD...";
9002 LET Z=0
9010 DIM W(704)
9020 FOR X=0 TO 21
9021 IF Z=0 THEN PRINT AT 20,22;
"1";
9022 IF Z=1 THEN PRINT AT 20,22;
"2";
9023 IF Z=2 THEN PRINT AT 20,22;
"E";
9024 IF Z=3 THEN PRINT AT 20,22;
"4";
9025 LET Z=Z+1
9026 IF Z>3 THEN LET Z=0
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 9300
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
9241 PRINT AT 20,22;"DONE.";
9252 GOSUB 6000
9260 RETURN
9300 LET T=N
9310 IF S>75 THEN LET T=E
9320 GOTO 9200
9800 STOP
9810 CLS
9820 CLEAR
9830 SAVE "TILES"
9840 LET L=USR 20500