ZX81 Programs


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

ZX81 Program Listing

**TILES**SLR/2013**** (tiles.p)


SYSTEM VARIABLES

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


LEGEND

9999 means line number
PRINT means treat as KEYWORD P


PROGRAM LISTING

   0 REM MCII
30403 ?/INKEY$?INKEY$?CALL INKEY$
??INKEY$?  ??INKEY$PI?8PI?
INPUT PI?ERR MSGS CALL LN Vò84
IF INT £FAST STR$ ACS ?C!Y-LN õ
PILN (INKEY$)(BLN UNPLOT RNDK;)
CONT óLN UNPLOT RNDK=)HOME  LN
UNPLOT RNDK>2úLN UNPLOT RNDK)/=
LN òINKEY$)CONT óLN òINKEY$)
HOME  LN òINKEY$LN òINKEY$
LN òINKEY$SGN LPRINT TAN FAST B
GOSUB DELETE LPRINT TAN Y0B
GOSUB DELETE SóW/RAND ;?õPI?J
LINE ?J?7TAN RND)5 FAST GOSUB
UNDRAW /RNDù7FAST ;FOR 5CHR$ ò
GOSUB PISTOP AT FOR GOSUB K
LPRINT ñQòù6:RNDCLEAR QT5CLEAR Q
TAN LN VòñCOPY RETURN JFAST
GOSUB PILPRINT COS //LN VòG4IF
LN Vò?RETURN COPY CSAVE ñCOPY
RETURN JFAST GOSUB PILPRINT C
INPUT JERR MSGS 8COS 9EDIT LN X÷
ASN DRNDTAN ACS UNPLOT 6ORNDEO
RND?NEW ?PCOS LN CALL INKEY$C
NEXT TAN YF( AND GOTO PICHAR Yñ
ACS CKòYôACS DKòACS ÷PRINT LN
INT INKEY$÷ACS ?KòINPUT ?CHAR )2
£UKRND<IF VAL INKEY$LET J4LET
KRETURN !SòINPUT ?/QY*( AND
GOTO PI?NEW 3DEF PROC VAL VAL
VAL JACS (ACS (ACS (POP LINE DD
AT CHAR ùAT CHAR ùGOSUB UNDRAW
£RNDù76:RNDAT Y/(MURNDY5)MTRND
TAN STR$ FAST VAL RETURN
8218 RNDACS AUTO CõLN ( /QE:RND
LN DO PI/CRETURN RNDABS JPIRND
ACS AUTO CõLN ( /*E:RNDPRINT
LET E:RND?76:RND5TRNDPAT LPRINT
SGN TAN 7PRINT 6:RNDCLEAR QT5UU
RNDXMURNDRETURN òATN PUSH PILET
TAN U5RNDRETURN  CöXM5RND/AE£RND
ñSAVE òùQ?FAST LN CALL INKEY$C
CLS LPRINT RETURN CASN
RETURN ZC:RETURN D4÷ACS 0F?O4
CLS ?/INKEY$LN PUSH !/ABS ?LCOS
,LN õPI<"/PRINT RETURN CALL Sù
RETURN ""ACS R AND FPINEW Z5)ñ
CHAR ôRETURN 5K£RETURN ñCô
RETURN *SôJLN õPIACS õPI7/PRINT
NEW ZLN õPIJ?!PIINT º?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 ùCALL ?+DEF PROC ?0CHAR STOP
;STOP /<>LPRINT AT ACS ?TAB (
INKEY$TAN ERR MSGS ?*>=(INKEY$
FOR ?CCHAR ACS ?TAB (INKEY$TAN
GOSUB OFFMRNDONICLEAR ?Rö GOSUB
DELETE /GOSUB DELETE /READ
END PROC GOSUB DELETE Kñ76MRND
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
óLN NEXT AUTO FAST LN LEN AUTO
LPRINT LN >ERR MSGS LN A
ERR MSGS LN LLIST !)CLEAR CALL ñ
LN IF DEF PROC E?RNDLN INPUT
DEF PROC )RUN CALL ñô 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 EúE?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 WMõEND 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 ¶
PROTECT RETURN PLOT ATN DATA
EDIT RETURN UNPLOT ATN ³EDIT
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 òDPOKE 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 !?SUNDRAW 5?ó?S
UNDRAW SCROLL RETURN ?4SGN LN
RUN DEF PROC 5/DPOKE LN SUNDRAW
/LEN ñRETURN RETURN GOSUB POP
ACS 1**?POKE DEF PROC UNTIL 7
RESTORE STR$ FOR FAST 67RNDRND
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 PRINT 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 /òLPRINT LET LPRINT AT
JTAN 5CLEAR ACS LN XUNDRAW 5ñ
EXP LN XUNDRAW LN LET DPOKE 5
CLEAR ACS LN XUNDRAW 5ñ:?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 ñTERROR VAL ñ  VAL ñM
TRACE VAL ?CHAR UNDRAW 5INPUT
DEF PROC LN SUNDRAW /RESEQ 5RND
TRACE LN SUNDRAW /óLN LOOP
ERROR 5IF DEF PROC LN SUNDRAW /
CHAR Y?LN BDPOKE E?RNDFAST LN X
UNDRAW ñCOPY COPY LN TRACE  ó
PRINT LN RUN DEF PROC LET
RETURN "CõLN BDPOKE /INPUT
LPRINT VAL GOSUB OFF?RNDLN OFF
DPOKE Y)LN UUNDRAW YñLPRINT ?U
UNDRAW LN IUNDRAW LN SQR UNDRAW
5CALL EDIT LN XUNDRAW 5PRINT !
LN SUNDRAW LN -DPOKE RETURN ,C>
RETURN ;ASN CLS DPOKE RETURN +
ASN CLS DPOKE 5.CHAR LN SUNDRAW
JTAN 5XERROR LN SUNDRAW ?CLS
DPOKE 5ñRNDACS AUTO TAB :"JLN
RUN DEF PROC UTRNDRETURN )S
UNDRAW :(Y/5URND-CHAR ?PRINT !
LN ERR MSGS UNDRAW Y?LN BDPOKE 5
RUN DEF PROC LN SUNDRAW /JLN H
TRACE 5RUN ERROR LN SUNDRAW /8?
NEW 3DEF PROC 5ñRNDACS AUTO C:5S
RND-ACS COPY LEN WUSR ?!?òùUTRND
CHR$ UNPLOT .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 ñWRNDòLN LINE
CALL RETURN 0SúRETURN RNDLN -
DPOKE ó/INPUT RETURN (M÷
END PROC CôRETURN $4òóòúACS
COPY òLN ³CHAR A ?DDGOSUB
UNDRAW ?RNDùCHAR U÷END PROC
RETURN $C!RETURN (4òJTAN ?TAN
TAN RND9ñWRNDJMöEND PROC úY
ACS ?4KACS LIST ACS RNDFAST
END PROC OASN CONT ERR MSGS
LPRINT ?FFAST LN SCROLL CHAR
LPRINT óACS ?CNEXT J?6ùEND PROC
UöEND PROC LN DPEEK CHAR RETURN
ñ4"Y5LN UUNDRAW 5SAVE CHAR LN S
UNDRAW UöEND PROC 5õEND PROC
ERROR ôS**?TAN EùEND PROC )M 
GOSUB DELETE GOSUB OFF?RNDGOSUB
DELETE SQR INT ³FAST LN
NOSTALGIC DPOKE ?NLPRINT ""
GOSUB OFFñEND PROC LN OFFDPOKE )
  LN OFFDPOKE E?RNDGOSUB OFFñ
END PROC ;6ñEND PROC ñ  ?COS :
LN -DPOKE LN SCHAR RETURN ñASN
RESEQ RETURN  4úLN 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 "
LN LOOP ERROR /END WHEN
RETURN INKEY$4!5RNDTRACE 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 )CùLPRINT X""LN -
DPOKE ?5 LN -DPOKE /FOR ?ññ /ù
LN POKE DEF PROC ñ  GCOS £)ù
END PROC >TAN B.GOSUB DELETE
ERR MSGS EDIT LIST INT ºSTR$ LN
NOSTALGIC DPOKE FOR SGN ;FOR
TAN EñEND PROC 6õEND PROC TAN ?L
COS EõEND PROC FOR GOSUB KGOSUB
DO õEND PROC TAN FAST
END PROC GOSUB OFFñEND PROC B
GOSUB DELETE FAST AT LPRINT LN
NOSTALGIC DPOKE VAL FAST LN ?
DEF PROC LPRINT AT ?7?TAN FOR ö!
?RETURN  CñACS  DRAW ?FOR 5  
ACS T3Kñ;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 +Cô
RETURN -47AT LINE ?RETURN  4ô
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 ñ?DRAW VAL FAST TAN
NOSTALGIC PUSH TAN RETURN CODE 4
G5õEND PROC YELN UUNDRAW YFAST
LN BDPOKE ICOPY LN 5 YSGN LN B
DPOKE 5>DRAW /USR EõEND PROC
GOSUB DO õEND PROC JGOSUB
DELETE LINE ?COS ,?TAN RETURN
RND4õ5ARND/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 /
º77LN NOSTALGIC DPOKE FOR TAN
RETURN SGN 4+LN ERR MSGS UNDRAW
5LIST DRAW ?SUNDRAW ?PCOS ACS ?5
ñ TAB ?UNDRAW TAN RETURN SQR
TAB CONT ERR MSGS LN ERR MSGS
UNDRAW 5úUNDRAW ?SUNDRAW JXACS ?
INT ¹?ELSE A )RND ö!GOSUB
DELETE Kñ;ZACS GOSUB
CLR STACK ·GOSUB 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 >=µUNDRAW
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 UõEND PROC
DEF PROC £E?RND6?RNDöôLN BDPOKE
(CLS $4PLOT LPRINT GOSUB UNDRAW
?RNDTAN 5Eú/ó5"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 /!YE5ORNDLN 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$ 0ö DEF PROC ù/ TO
FAST E-RND)õ ;6-RNDLPRINT TAN
LN -DPOKE LN SCHAR RETURN ñC1
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 ñEND PROC
VAL FAST LN òEDIT 6ñEND PROC
FAST LN PAUSE PROTECT RETURN
10249 KPRINT LN $EDIT /LIST SGN
GOSUB DELETE FAST AT LPRINT LN ³
TRACE AT GOSUB CALL ñEND PROC
FAST LN òEDIT ñ3 LN ?DEF PROC
LPRINT TAN FAST LN LET DEF PROC
LPRINT RETURN ?""J?FY
48672 £RNDñSAVE òùYL?TAN ?7Y
48672 /PAUSE LN òEDIT FAST FAST
LN PAUSE PROTECT RETURN
10257 C!RETURN 0SLET RETURN AK
GOSUB LN $EDIT /CONT 5  SGN ,
RETURN -C(RETURN LC?CHR$ 0DFAST
DDAT ùö DEF PROC ù</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 ?PCòRTAN ?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 4ú5?EDIT
LN SUNDRAW YABS /CHAR RETURN
AND 4õ5·EDIT /LIST PRINT YB5
GOSUB DELETE LN UUNDRAW LET
RETURN =4ôYTAB /GRETURN <>4ôY
ASN /8RETURN >C+RETURN <4÷YASN
LN 5AUTO /<RETURN >=4ú5CóLN X
UNDRAW YPAUSE RETURN <=TAB
CONT ERR MSGS YIF LN 5AUTO LN -
DPOKE RETURN AND ASN ,EDIT TAN
LN BDPOKE EúRND7LN BREAK DPOKE
FOR LN NOSTALGIC DPOKE FOR ?X
UNDRAW LN XAUTO 6õEND PROC 6÷
END PROC TAN EõEND 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 =4ôY
TAB /ARETURN <>4ôYASN /2RETURN >
4÷YASN LN 5AUTO /!RETURN <C<
RETURN >=4ôY AND RETURN <=TAB
CONT ERR MSGS 5CóLN XUNDRAW Y
ABS ?+AUTO E÷END PROC GOSUB
UNDRAW ñEND PROC úWOY""RETURN  
COS 7ó/POKE 5RAUTO ?SUNDRAW LN
SCROLL ò5VRNDACS QTAN 5LEN AUTO
?SUNDRAW 5VRNDACS PLOT ?÷ò5ò LN
**ù""FAST LN 2DEF PROC SGN ?
DATA ú5ò LN **ù""LN 2DEF PROC
COS LN 2DEF PROC COS LOOP DATA E
£RND/SCROLL óóóVAL óóóóVAL LN
EXP AUTO 5ó LN **ùAT LN 2ù7Y
28963 7AT ?7?7QREM 7?7?7TAN 77
AUTO 7ERROR ù7U£RND1""U$RND0TAN
LN -DPOKE LN SCHAR Y5LN UUNDRAW
YGOSUB LN BDPOKE YOFF5ñEND PROC
LN UUNDRAW 5OFFDPOKE LN SUNDRAW
LN HTRACE 5UNTIL DEF PROC ?S
UNDRAW 7D7FAST FAST AT
END PROC LN COS :AT LN DUP
DEF PROC GOSUB DO ñEND PROC TAN
EñEND PROC DATA LOOP <Q /óEñ
END PROC ?LCOS GOSUB KTAN FAST
LN ERR MSGS UNDRAW 5GOSUB
UNDRAW LN XUNDRAW LPRINT LN X
UNDRAW 5Dù?XUNDRAW LN DPOKE 5
NOSTALGIC DPOKE LN SUNDRAW 5FOR
SGN ?XUNDRAW EôRND9QCOPY FQCOPY
FQ 6ùEND PROC Y5E?RNDLN UUNDRAW
I:UõEND PROC LINE LN XUNDRAW 5
ATN DEF PROC ?SUNDRAW £JM5RNDöô?
7(UNPLOT $4RUN 54 6?RNDE0RNDñ
HOME  ù6ñEND PROC 6õEND PROC
TAN RND?:RND?)RND?1RND?4RND
FOR ?7RNDQ?  Q?
30505 
   2 REM
30241 :1LN ATN DEF PROC LN Eú5
CLEAR USER :ñLN ATN DEF PROC ?
DRAW END PROC ±                 
             ²)EEND PROC ñ4 LN
IF DEF PROC LN .CHAR 5ñ FAST 5= 
SGN 7GOSUB DO õ*6÷*?¹END PROC  !
!!!¸¸¸¸!!!!¸¸¸¸!!!!           )
PUSH END PROC ñ4 LN IF DEF PROC
Eõ*76õ*GOSUB OFF÷*BGOSUB DELETE
IF DPEEK END PROC ?LEN END PROC
´                              ÷
)AEND PROC ñ4 LN IF DEF PROC 5£
RND ñFAST 5$RND)TRACE FAST 5ñ 
ERR MSGS EDIT LPRINT SGN ;FAST
PUSH NOSTALGIC SGN ;6ù*LN FOR
RESTORE 5  6$*5  6)*5õ 6+*5ú 6;*
E+*61*E;*65*LN CINDENT 5  69*LN
1WHILE EõEND PROC FAST LN RND
TRACE LN LINE TRACE SGN LN >
DRAW 69*E9*FAST 5  SGN BGOSUB
DELETE ASN PROTECT LN òDELETE ?5
Eõ*6D*Eõ*FAST 5  SGN BGOSUB
DELETE ASN ?IF ?Eõ*FAST 5- SGN ;
6D*Eõ*FAST 5+ SGN BGOSUB DELETE
PAUSE ?Eõ*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*5ñ 
FAST 54 FAST ED*SGN LN )TRACE
FAST EH*ERR MSGS EDIT LPRINT
SGN ;FAST PUSH NOSTALGIC SGN ;6P
*EP*GOSUB UNDRAW X*DùSTR$ LN
NOSTALGIC DPOKE FOR SGN 6T*TAN E
+*6õ*E;*6L*E9*FAST 5W SGN B
GOSUB DELETE TAB FDELETE E+*
FAST 5ñ SGN BFOR GOSUB DELETE 6õ
*Eõ*FAST 5  SGN BGOSUB DELETE
ASN PIDELETE IF PIDELETE 5+ 6õ*E
9*FAST 5S SGN BGOSUB DELETE TAB
CURSOR DELETE E+*FAST 5ñ SGN ;6õ
*Eõ*FAST 5+ SGN BGOSUB DELETE
PAUSE ?DELETE 5  6õ*E9*FAST 5A 
SGN BGOSUB DELETE TAB $DELETE E;
*FAST 5ñ 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 5ñ SGN ;6L*EL*
FAST 53 SGN BGOSUB DELETE PAUSE
ABS DELETE 5  6L*LN DEF PROC ET*
FAST 5ñ SGN BGOSUB DELETE TAB
SLOW DELETE TAN ET*FAST 5õ SGN B
GOSUB DELETE TAB NEXT DELETE
TAN Eõ*6+*EL*6;*LN TRACE
RESTORE 5= FAST 5- SGN CALL
EDIT LN PRINT !?<DO >)>DO ññ LN
IF DEF PROC E9*FAST 5W SGN B
GOSUB DELETE TAB VDO ?MDO NORTH)
HDO ñõ LN IF DEF PROC E9*FAST 5S
 SGN BGOSUB DELETE TAB RESEQ DO
?DO SOUTH)PROTECT DO ñõ LN IF
DEF PROC E9*FAST 5A SGN BGOSUB
DELETE TAB ?DO ??DO WEST)DUP DO
ñô LN IF DEF PROC E9*FAST 5D 
SGN BGOSUB DELETE TAB -DO ?$DO E
AST)¹DO ñô LN IF DEF PROC E9*
FAST 5E SGN BGOSUB DELETE TAB P
DO ?GDO ENTER)BDO ñõ LN IF
DEF PROC E9*FAST 5O SGN BGOSUB
DELETE TAB PEEK DO ?ASN DO OPEN)
LEN DO ñô LN IF DEF PROC E9*
FAST 5H SGN BGOSUB DELETE TAB
LIST DO ?SCROLL DO HIT)SLOW DO ñ
ó LN IF DEF PROC E9*FAST 5B SGN
BGOSUB DELETE TAB $LOOP ?ôLOOP B
UY)ñLOOP ñó LN IF DEF PROC E9*
FAST 5C SGN BGOSUB DELETE TAB F
LOOP ?6LOOP CAST)2LOOP ñô LN IF
DEF PROC E9*FAST 5Y SGN BGOSUB
DELETE TAB TRACE LOOP ?RNDLOOP Y
ELL)WLOOP ñô LN IF DEF PROC E9*
FAST 5Z SGN BGOSUB DELETE TAB
DPEEK LOOP ?DATA LOOP ZZZ)RESEQ
LOOP ñó LN IF DEF PROC E9*FAST 5
SGN BGOSUB DELETE TAB ´LOOP ??
LOOP QUIT)?LOOP ñô 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 !?óEXIT S
TART)RETURN LOOP ñõ LN IF
DEF PROC LN TRACE RESTORE LN 1
WHILE 5= FAST 5- SGN CALL EDIT
LN PRINT !?CEXIT OVER? )6EXIT ñö
 LN IF DEF PROC EõEND 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 ñò LN IF
DEF PROC E9*FAST 5Y SGN BGOSUB
DELETE TAB ?EXIT ??EXIT YES)?
EXIT ñó LN IF DEF PROC E9*FAST 5
SGN BGOSUB DELETE TAB ºEXIT
TAN E9*FAST 5Y SGN BGOSUB
DELETE ASN .EXIT ??EXIT LN
TRACE RESTORE 5= FAST 5- SGN
CALL EDIT LN PRINT !?PEXIT OKAY.
..)IEXIT ñ÷ 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 !ET*FAST 5ö SGN B
GOSUB DELETE TAB CLS EXIT ?
PAUSE EXIT CITY)INPUT EXIT ñô 
LN IF DEF PROC ET*FAST 5÷ SGN B
GOSUB DELETE TAB 0UNTIL ?<UNTIL
DUNGEON)£UNTIL ñ÷ LN IF
DEF PROC ET*FAST 5ö SGN BGOSUB
DELETE ASN INKEY$UNTIL IF INKEY$
UNTIL ?SUNTIL NOT HERE)KUNTIL ñ!
 LN IF DEF PROC TAN LN TRACE
RESTORE 5= FAST 5- SGN CALL
EDIT LN PRINT !?INDENT UNTIL DIR
?)EXIT UNTIL ñô LN IF DEF PROC
LN TRACE RESTORE LN 1WHILE 5= 
FAST 5- SGN CALL EDIT LN PRINT !
??UNTIL >)?UNTIL ññ LN IF
DEF PROC EõEND PROC FAST LN RND
TRACE LN LINE TRACE SGN LN >
DRAW 69*E9*FAST 5W SGN BGOSUB
DELETE TAB MUNTIL ?DUNTIL NORTH)
8UNTIL ñõ LN IF DEF PROC E9*
FAST 5S SGN BGOSUB DELETE TAB
SGN UNTIL ?COS UNTIL SOUTH)?
UNTIL ñõ LN IF DEF PROC E9*FAST
5A SGN BGOSUB DELETE TAB LOAD
UNTIL ?NEW UNTIL WEST)LLIST
UNTIL ñô LN IF DEF PROC E9*FAST
5D SGN BGOSUB DELETE TAB $WHILE
?ôWHILE EAST) WHILE ñô 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 ñ
ö LN IF DEF PROC TAN LN TRACE
RESTORE 5= FAST 5- SGN CALL
EDIT LN PRINT !?<WHILE NOT HERE)
"WHILE ñ! LN IF DEF PROC TAN 5ñ 
6INKEY$*E+*FAST 5ò SGN BFOR
GOSUB DELETE FAST E+*FAST 5ò 
SGN ;SGN 7GOSUB DO õ*6÷*5ñ 6
DPOKE *E;*FAST 5ò SGN BFOR
GOSUB DELETE FAST E;*FAST 5ò 
SGN ;SGN 7GOSUB DO L*6N*LN
DEF PROC ET*FAST 5ñ SGN BGOSUB
DELETE TAB ôWHEN 5ó FAST E$*SGN
;6TRACE *ET*FAST 5ò SGN BGOSUB
DELETE TAB /WHEN 5" 6TRACE *ET*
FAST 5ó SGN BGOSUB DELETE TAB G
WHEN 5£ 6TRACE *ET*FAST 5ô SGN B
GOSUB DELETE TAB RNDWHEN 5$ 6
TRACE *ET*FAST 5õ SGN BGOSUB
DELETE TAB LOOP WHEN 5: 6TRACE *
ET*FAST 5ö SGN BGOSUB DELETE
TAB ?WHEN 5? FAST E)*SGN ;6
TRACE *ET*FAST 5÷ SGN BGOSUB
DELETE TAB ²WHEN 5) 6TRACE *Eõ*
FAST E+*SGN BGOSUB DELETE TAB E
WHEN EL*FAST E;*SGN BGOSUB
DELETE TAB EWHEN 5ñ FAST E)*SGN
;6TRACE *LN 0DATA EDPOKE *FAST 5
ñ SGN ;6DPOKE *EL*76L*GOSUB OFFN
*BGOSUB DELETE IF SCROLL WHILE E
INKEY$*FAST 5ñ SGN ;6INKEY$*Eõ*7
6õ*GOSUB OFF÷*BGOSUB DELETE IF
TAB WHILE E)*FAST 5ñ SGN ;6)*E)*
FAST 5ñ SGN BGOSUB DELETE PAUSE
÷INDENT 5  6)*E$*FAST 5ñ SGN ;6$
*E$*FAST 5÷ SGN BGOSUB DELETE
PAUSE BINDENT 5  6$*TAN 5EDIT *
GOSUB OFFñEND PROC LN OFFDPOKE 5
FAST 5) SGN LN )TRACE LN
UNTIL DEF PROC 5ñ 6TRACE *5*LN
SAVE CHAR LN NOSTALGIC TRACE ?*
INDENT µ¶· µ²±ôµ¶ò ò ñ )DELETE
INDENT ñ( LN LINE TRACE 5*LN ?
TRACE LN PCURSOR 5ò 6TRACE *5*
LN SAVE CHAR LN NOSTALGIC TRACE
?-INDENT µ¶µ µ²´ñµ¶  ò ñ )¶
INDENT ñ( LN LINE TRACE 5*LN ?
TRACE LN PCURSOR 5ó 6TRACE *5*
LN SAVE CHAR LN NOSTALGIC TRACE
?ASN INDENT ·ô  ñò¶ö  ·ô¶öñò)U
INDENT ñ( LN LINE TRACE 5*LN ?
TRACE LN PCURSOR 5ô 6TRACE *5*
LN SAVE CHAR LN NOSTALGIC TRACE
?RETURN INDENT ³    ó³ó  ³ ³ó ó)
INPUT INDENT ñ( LN LINE TRACE 5*
LN ?TRACE LN PCURSOR 5õ 6TRACE *
5*LN SAVE CHAR LN NOSTALGIC
TRACE ?MRESEQ ô  ·ò¶öñ ·ô öñò¶)6
RESEQ ñ( LN LINE TRACE 5*LN ?
TRACE LN PCURSOR 5ö 6TRACE *5*
LN SAVE CHAR LN NOSTALGIC TRACE
?DPEEK RESEQ    ³ó³ó  ³  ó ó³)
UNTIL RESEQ ñ( LN LINE TRACE 5*
LN ?TRACE LN PCURSOR 5÷ 6TRACE *
5*LN SAVE CHAR LN NOSTALGIC
TRACE ?,RESEQ   ·ô¶öñò·ô  ñò¶ö)º
RESEQ ñ( LN LINE TRACE 5*LN ?
TRACE LN PCURSOR 5! 6TRACE *5*
LN SAVE CHAR LN NOSTALGIC TRACE
?EXP RESEQ   ³ ³ó ó³    ó³ó)Y
RESEQ ñ( LN LINE TRACE 5*LN ?
TRACE LN PCURSOR 5ù 6TRACE *5*
LN SAVE CHAR LN NOSTALGIC TRACE
?òOFF ·ô öñò¶ô  ·ò¶öñ)PAUSE
RESEQ ñ( LN LINE TRACE 5*LN ?
TRACE LN PCURSOR 5ú 6TRACE *5*
LN SAVE CHAR LN NOSTALGIC TRACE
?QOFF ³  ó ó³   ³ó³ó )AOFFñ( LN
LINE TRACE 5*LN ?TRACE LN P
CURSOR 5" 6TRACE *5*LN SAVE
CHAR LN NOSTALGIC TRACE ?
CLR STACK OFF··   ñôôôôò ò   )
RESEQ OFFñ( LN LINE TRACE 5*LN ?
TRACE LN PCURSOR 5£ 6TRACE *5*
LN SAVE CHAR LN NOSTALGIC TRACE
?2OFF ±  · õ ±    ¹  ):OFFñ( LN
LINE TRACE 5*LN ?TRACE LN P
CURSOR 5$ 6TRACE *5*LN SAVE
CHAR LN NOSTALGIC TRACE ?ABS OFF
úùúùùúùúúùúùùúùú)TAB OFFñ( LN
LINE TRACE 5*LN ?TRACE LN P
CURSOR 5: 6TRACE *5*LN SAVE
CHAR LN NOSTALGIC TRACE ?ö
CURSOR  öôôö öò ö ôöòöò)PLOT OFF
ñ( LN LINE TRACE 5*LN ?TRACE LN
PCURSOR 5? 6TRACE *5*LN SAVE
CHAR LN NOSTALGIC TRACE ?U
CURSOR  µù µ±²õµ::õòñòñ)ECURSOR
ñ( LN LINE TRACE 5*LN ?TRACE LN
PCURSOR 5( 6TRACE *5*LN SAVE
CHAR LN NOSTALGIC TRACE ??
CURSOR  µú µ±²õµ::õòñòñ)RESTORE
CURSOR ñ( LN LINE TRACE 5*LN ?
TRACE LN PCURSOR 5) 6TRACE *5*
LN SAVE CHAR LN NOSTALGIC TRACE
?6CURSOR ·  ô ùú  ùú  ùú )>
CURSOR ñ( LN LINE TRACE 5*LN ?
TRACE LN PCURSOR TAN 5ñ FAST 5( 
SGN 7GOSUB DO 5*67*5( FAST E
TRACE *FAST 5ñ SGN BFOR GOSUB
DELETE SGN LN )TRACE FAST E5*
SGN ;GOSUB UNDRAW EDIT *DùFAST E
õEND 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 Eù*FAST 55 FAST E
INKEY$*FAST 5ñ SGN BFOR GOSUB
DELETE SGN LN )TRACE FAST 5ô 
SGN LN )TRACE FAST 55 ERR MSGS
EDIT LPRINT SGN ;FAST PUSH
NOSTALGIC FAST 5ô ERR MSGS EDIT
LPRINT SGN ;FAST PUSH NOSTALGIC
FAST EDPOKE *FAST 5ñ SGN BFOR
GOSUB DELETE SGN LN )TRACE FAST
5ñ ERR MSGS EDIT LPRINT SGN ;
FAST PUSH NOSTALGIC SGN ;6H*5( 
FAST ETRACE *FAST 5ñ SGN BFOR
GOSUB DELETE SGN LN )TRACE FAST
5ñ SGN ;6EXIT *5ñ FAST 5ô SGN 7
GOSUB DO INDENT *6OFF*EH*FAST E
EXIT *GOSUB UNDRAW EDIT *DùSTR$
LN NOSTALGIC DPOKE FOR SGN SGN
FOR ?EH*FAST 5ñ SGN ;FAST EEXIT
*FAST 5ñ SGN ;GOSUB UNDRAW EDIT
*DùSTR$ LN NOSTALGIC DPOKE FOR
SGN SGN FOR ?EH*FAST 5ò SGN ;
FAST EEXIT *FAST 5ò SGN ;GOSUB
UNDRAW EDIT *DùSTR$ LN
NOSTALGIC DPOKE FOR SGN SGN FOR
?EH*FAST 5ó SGN ;FAST EEXIT *
FAST 5ó SGN ;GOSUB UNDRAW EDIT *
STR$ LN NOSTALGIC DPOKE FOR
SGN SGN FOR ?EH*FAST 55 SGN ;6H*
EEXIT *FAST 5ô SGN ;6EXIT *E
INDENT *76INDENT *GOSUB OFFOFF*B
GOSUB DELETE IF 7DATA TAN 5ò 
FAST 5= SGN 7GOSUB DO INDENT *6
OFF*Eù*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 !
?LPRINT RESTORE          )**
RESTORE ñù LN IF DEF PROC TAN 5>
 FAST 5- SGN CALL EDIT LN PRINT
!?óREAD CREATING)CLS RESTORE ñ! 
LN IF DEF PROC 5< FAST 5- SGN
CALL EDIT LN PRINT !?8READ WORLD
...)0READ ñ! LN IF DEF PROC 5  6
)*5X*GOSUB OFFñEND PROC LN OFF
DPOKE 5""òLN 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 !??READ ñ)?READ ññ LN
IF DEF PROC E)*FAST 5ñ SGN B
GOSUB DELETE TAB 7READ 5= FAST 5
SGN CALL EDIT LN PRINT !?,
READ ò);READ ññ LN IF DEF PROC E
)*FAST 5ò SGN BGOSUB DELETE TAB
ACS READ 5= FAST 5- SGN CALL
EDIT LN PRINT !?TAB READ ·)AT
READ ññ LN IF DEF PROC E)*FAST 5
ó SGN BGOSUB DELETE TAB NEXT
READ 5= FAST 5- SGN CALL EDIT
LN PRINT !?REM READ ô)DIM READ ñ
ñ LN IF DEF PROC E)*FAST 5ñ SGN
;6)*E)*FAST 5ó SGN BGOSUB
DELETE PAUSE <NOSTALGIC 5  6)*5 
 FAST 53 SGN 7GOSUB DO ;*6.*E+*
FAST 54 SGN LN )TRACE FAST E;*
FAST 5ñ ERR MSGS EDIT LPRINT
SGN ;FAST PUSH NOSTALGIC SGN ;6õ
*5ñ 6USER *E+*FAST 5  SGN B
GOSUB DELETE TAB RESEQ
NOSTALGIC ?¹USER E;*FAST 5  SGN
BGOSUB DELETE TAB DUP NOSTALGIC
?¹USER Eõ*FAST 54 SGN BFOR
GOSUB DELETE GOSUB UNDRAW X*Dù
STR$ LN NOSTALGIC DPOKE FOR SGN
6BREAK *Eõ*FAST 5ñ SGN BFOR
GOSUB DELETE GOSUB UNDRAW X*Dù
STR$ LN NOSTALGIC DPOKE FOR SGN
6PUSH *EPUSH *FAST 5õ SGN B
GOSUB DELETE PAUSE ASN
NOSTALGIC Eõ*FAST 5ò SGN BFOR
GOSUB DELETE GOSUB UNDRAW X*Dù
STR$ LN NOSTALGIC DPOKE FOR SGN
6PUSH *EBREAK *FAST 5õ SGN B
GOSUB DELETE PAUSE THEN
NOSTALGIC EPUSH *6BREAK *5ARND
LN PUSH DRAW FAST 5 ñSGN LN
CLEAR DEF PROC 6END WHEN *5ARND
LN PUSH DRAW FAST 5 ñSGN LN
CLEAR DEF PROC 6?*E?*FAST 5M 
SGN BGOSUB DELETE PAUSE )USER ?
TO USER EEND WHEN *FAST 5? SGN
BGOSUB DELETE PAUSE 9USER 5ô 6
USER *EEND WHEN *FAST 5; SGN B
GOSUB DELETE PAUSE TUSER 5ò 6
USER *EEND WHEN *FAST 5R SGN B
GOSUB DELETE PAUSE EDIT USER 5ó 
6USER *EEND WHEN *FAST 5UNDRAW  
SGN BGOSUB DELETE PAUSE USER
USER 5õ 6USER *EEND WHEN *FAST 5
READ  SGN BGOSUB DELETE PAUSE ?
USER 5ö 6USER *EEND WHEN *FAST 5
USER  SGN BGOSUB DELETE PAUSE ¹
USER 5÷ 6USER *Eõ*GOSUB UNDRAW X
*DùFAST 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 !?ABS USER DONE.)LN
USER ñõ LN IF DEF PROC LN TRACE
RESTORE TAN EBREAK *6USER *E?*
FAST 5UNDRAW  SGN BGOSUB DELETE
PAUSE RAND USER EPUSH *6USER *?¹
USER TAN         + + T?         
                                
         Q?                     
                                
   óWHEN  REM       MCODER II   
      COPYRIGHT 1983   D C THREL
FALL COMPILER AT 17300 PROG AT 2
0500
  10 REM **TILES**
  20 CLS
  30 CLEAR
  40 PRINT                    
           ²"
  50 FOR L=1 TO 20
  60 PRINT " !!!!¸¸¸¸!!!!¸¸¸¸!!!
!           ";
  70 NEXT L
  80 PRINT                    
           ÷";
  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$="µ¶· µ²±ôµ¶ò ò ñ "
3030 GOSUB 4000
3040 LET O=2
3050 LET A$="µ¶µ µ²´ñµ¶  ò ñ "
3060 GOSUB 4000
3070 LET O=3
3071 LET A$="·ô  ñò¶ö  ·ô¶öñò"
3072 GOSUB 4000
3073 LET O=4
3074 LET A$="³    ó³ó  ³ ³ó ó"
3075 GOSUB 4000
3076 LET O=5
3077 LET A$="ô  ·ò¶öñ ·ô öñò¶"
3078 GOSUB 4000
3079 LET O=6
3080 LET A$="   ³ó³ó  ³  ó ó³"
3081 GOSUB 4000
3082 LET O=7
3083 LET A$="  ·ô¶öñò·ô  ñò¶ö"
3084 GOSUB 4000
3085 LET O=8
3086 LET A$="  ³ ³ó ó³    ó³ó"
3087 GOSUB 4000
3088 LET O=9
3089 LET A$=" ·ô öñò¶ô  ·ò¶öñ"
3090 GOSUB 4000
3091 LET O=10
3092 LET A$=" ³  ó ó³   ³ó³ó "
3093 GOSUB 4000
3200 LET O=11
3210 LET A$="··   ñôôôôò ò   "
3220 GOSUB 4000
3300 LET O=12
3310 LET A$=" ±  · õ ±    ¹  "
3320 GOSUB 4000
3400 LET O=13
3410 LET A$="úùúùùúùúúùúùùúùú"
3420 GOSUB 4000
3500 LET O=14
3510 LET A$=" öôôö öò ö ôöòöò"
3520 GOSUB 4000
3600 LET O=15
3610 LET A$=" µù µ±²õµ::õòñòñ"
3620 GOSUB 4000
3630 LET O=16
3640 LET A$=" µú µ±²õµ::õòñòñ"
3650 GOSUB 4000
3700 LET O=17
3710 LET A$="·  ô ùú  ùú  ùú "
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;
"ñ";
9022 IF Z=1 THEN PRINT AT 20,22;
"ò";
9023 IF Z=2 THEN PRINT AT 20,22;
"·";
9024 IF Z=3 THEN PRINT AT 20,22;
"ô";
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