--- title: "Mazogs" id: 51915 type: "computer_media" slug: "mazogs" url: "http://localhost/computer_media/mazogs/" markdown_url: "http://localhost/computer_media/mazogs.md" published_at: "2023-08-16T01:42:21+00:00" modified_at: "2026-04-03T07:59:12+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2019/02/20230809-041332.jpg" excerpt: "Navigate a randomly generated maze, hunt treasure, and battle enemy Mazogs across three difficulty modes in this machine-code-powered maze adventure." category: - name: "Archived Media" slug: "archived-media" taxonomy: "category" url: "http://localhost/category/archived-media/" post_tag: - name: "Bug-Byte Software" slug: "bug-byte-software" taxonomy: "post_tag" url: "http://localhost/tag/bug-byte-software/" - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "TS 1000" slug: "ts1000" taxonomy: "post_tag" url: "http://localhost/tag/ts1000/" model: - name: "Timex/Sinclair 1000" slug: "ts-1000" taxonomy: "model" url: "http://localhost/model/ts-1000/" genre: - name: "Game" slug: "game" taxonomy: "genre" url: "http://localhost/type/game/" media_type: "Cassette" download_url: "https://archive.org/download/timex-sinclair-software-archive/Mazogs (1981)(Bug-Byte Software)(UK)(TS1000)(Cassette).zip" mediadate: "1981" producer_company: - id: 10706 title: "Bug-Byte Software" type: "company" url: "http://localhost/company/bug-byte-software/" related_products: - id: 13240 title: "Mazogs" type: "product" url: "http://localhost/product/mazogs-4/" media_type_tags: "Game" --- # Mazogs Mazogs is a maze-adventure game in which the player navigates a randomly generated maze to find hidden treasure while avoiding or fighting enemy Mazogs. The program relies heavily on machine code routines called via RAND USR at addresses such as 16620, 17310, 18602, 19226, 20199, and 20631, with BASIC serving primarily as a supervisor and menu/display layer. Three difficulty modes are offered: “Try It Out,” “Face a Challenge,” and “Maniac Mobile Mazogs,” each configured by POKEing control bytes at addresses around 19212–19225. The maze is generated procedurally at line 6141 onward, with a minimum path-length check (MOVES > 120) ensuring the layout is non-trivial before play begins. Score is calculated as a percentage of moves remaining versus moves allowed, with bonuses and penalties for killing Mazogs and using the VIEW command respectively. *** ## Program Analysis ### Program Structure The BASIC listing is organized into several functional blocks. Lines 1–8 are REM statements, with line 1 containing a large block of embedded machine code (the bulk of the game engine). Lines 108–128 define address constants for the machine code entry points. Lines 198–250 perform initialization and jump to the main menu at line 2000. Lines 1000–1060 implement the in-maze player control loop. Lines 2000–2278 handle the animated title screen and game-mode selection. Lines 3000–4534 manage game-over conditions, scoring, and post-game options. Lines 6010–6999 are subroutine utilities covering maze generation, situation reports, and key-wait routines. Line 9000 contains a CLEAR/SAVE/RUN sequence for saving the program. ### Machine Code Integration Nearly all graphics rendering, maze logic, enemy movement, and collision detection are handled by machine code stored in the REM statement at line 1. BASIC calls into this engine using `RAND USR` with hardcoded addresses. Key entry points include: - `USR 16620` / `USR 16672` — display/rendering initialization - `USR 16694` — maze generation - `USR 17028`, `17128`, `17171`, `17310`, `17365` — player movement and display update routines - `USR 18602` — general display/animation routine - `USR 19226`, `19239` — game state update (enemy movement, death checks) - `USR 20133`, `20199`, `20515`, `20631`, `20860` — maze post-processing and display finalization Return values from `USR` calls are frequently discarded by assigning to a throwaway variable `X` (e.g., `LET X=USR 18602`), a common idiom when only the side effects of the machine code matter. ### Address Constants and POKE Subroutine Rather than scattering raw numeric addresses throughout the code, the program defines named constants at lines 108–128: `MST` (maze store base = 29450), `MDR` (= 6100), `BB` (= 6030), `SUR` (= 6052), `INK` (= 6060), `PR` (= 6070), `CT` (= 6080), and `POKE` (= 6000). The subroutine at line 6010 writes a 16-bit value `N` to address `AD` and `AD+1` in low-byte/high-byte order, providing a reusable routine for passing parameters to the machine code engine through fixed memory locations. ### Game Modes Three modes are selectable from the menu. Their differences are encoded by POKEing configuration bytes before jumping to the shared game loop at line 3000: | Mode | Key POKEs | | --- | --- | | Try It Out | 19212=1, 19213=0; enables a maze-call POKE at 19892–19894 | | Face a Challenge | 19212=0, 19213=0, 20310=1 | | Maniac Mobile Mazogs | 19212=0, 19213=1, 20310=0, 19273=253 | ### Maze Generation and Validation Maze generation starts at line 6141 with `RAND` (to reseed the random number generator), then places the treasure at a random position within the maze buffer (`MST+128` to `MST+2938`). A guard at line 6144 rejects positions adjacent to byte value 8 (a wall marker). The machine code at `USR 16694` then draws the maze. After generation, a path-length check at line 6157 rejects mazes where `PEEK 16518 + PEEK 16519*256 <= 1200`, forcing a redraw until a sufficiently large maze is produced. ### Scoring and Situation Report The situation report subroutine (lines 6392–6999) calculates the distance to the treasure in `MOVES` via the `CT` machine code entry, then derives the moves allowed as `MOVES*4+10`. The kill bonus is stored at address 18779 as `INT(MOVES/5*VAL K$)`, capped at 255. The VIEW penalty is POKEd at 19225 as `30/VAL K$`. Final score at lines 4034–4046 reads remaining moves from 19214–19215 and expresses the result as an integer percentage. ### Key-Wait and Display Idioms Line 6062–6064 implements a clean debounced key-wait: first spin until no key is pressed, then spin until a key is pressed. The `INK` subroutine at line 6060 (`GOSUB INK`) delegates to `USR 6060` in machine code for the actual wait. The title animation loop (lines 2032–2072) scrolls “MAZOGS” down the right margin while cycling between two display states using POKE 18619 to switch character sets or display modes. ### Player Loop The in-maze player loop at lines 1020–1060 is compact. Movement is computed in a single expression at line 1050, adjusting `X` by ±1 for horizontal (keys `H`/`J`) and ±64 for vertical (keys `W`/`S`), with boundary clamping terms that add or subtract 64 when `X` falls outside the range `MST` to `MST+1568`. The updated position is written to the machine code parameter block at 16525–16526 before calling `RAND USR 17310` to redraw. ### Notable Anomalies - Lines 2150 and 2200 are missing (the menu branches to `GOTO 2150` and `GOTO 2200`, but the first executed lines in those blocks are 2152 and 2202 respectively) — this is intentional, as jumping to a non-existent line falls through to the next higher line number. - Line 3150 is referenced by `GOTO 3150` (line 3014) but does not appear in the listing; line 3160 is the next present line, which handles the exit display — again an intentional fall-through technique. - Line 6396 is targeted by `GOTO 6396` (line 6422) but is absent; line 6398 follows, causing execution to land at the `GOSUB CT` call — deliberate. - Line 6120 is targeted by `GOTO 6120` (line 6160) for maze redraw, but the listing shows 6110 as the nearest preceding line; the intervening lines (6120–6140) may be omitted from the listing but present in the saved file, or the jump lands at 6124. ## Source Code ``` 1 REM ###▖▒▘ STEP ###1~~#*#.UORNDM▜RNDU▜RND##A ▞▞D( CLEAR,,,,,,▘ CLEAR▘,,#M▜RNDTAN U▜RND RETURN█ IF LN RND RETURN"" IF SIN RNDY▖M▐RNDTAN Y▀M▐RNDTAN RETURNRND IF **RNDY▝M▐RNDTAN Y▘M▐RNDTAN [B]5 COPY COPY GOSUB #9RND GOSUB PI#▐TAN E[$]RNDU▚RND#▞Z7#( UNPLOT )RND ▞J;#( UNPLOT ▞ZF#( UNPLOT ▞I[B] GOSUB ##( IF TAN .......# ▝CODE ▘ REM E[$]RNDY█▞KVAL ▞RND#7( UNPLOT AT ( PLOT LN GOTO RNDTAN UPRNDM[£]RNDE[▒]RND 6[~~]RNDLN [/]RND GOSUB #[~~]RNDLN [O]RND RETURN▝C? RETURN▀C> RETURN▖C+LN CHR$ INKEY$ RETURN~~C STOPLN IF INKEY$ RETURN~~C>=LN 2PI RETURN~~CSTR$ LN #PI RETURN~~CEXP LN CHR$ INKEY$ RETURN~~CSIN LN IF INKEY$ RETURN~~C""LN 2PI RETURN~~C[T] U▗RNDWM▗RNDATN [>]RND5[£]RNDUPRNDWW[Y]ASN #PI LN [/]RNDE[$]RND▘█ ,,▞ #,,,,,,▞▀- #ACS ( IF ;Y [Y]ASN INKEY$ INKEY$ ▞▞7[Y]ASN INKEY$ INKEY$ ( RAND #[£]INKEY$ Y█STR$ LPRINT F[Y]""F[Y]""▘INKEY$ ,,[Y]""▘█ [B] GOSUB PI[Y]"".Y > GOSUB #[~~]RNDY~~TAN Y█STR$ LPRINT 7[Y]""7[Y]""▘Z ,,[Y]""▘█ [B] GOSUB PI[Y]"" GOSUB #[~~]RNDY~~TAN Y█STR$ LPRINT ▘INKEY$ [B] GOSUB PI[Y]""7[Y]""7[Y]""▘INKEY$ [B] GOSUB PI[Y]"" FOR ▘RND [B] GOSUB PIY #6[~~]RNDY~~TAN Y█STR$ LPRINT ▘Z ,,[Y]""7[Y]""7[Y]""▘Z ,,[Y]"" FOR ▘RND ,,Y #6[~~]RNDY~~TAN ▞ COPYVAL ▞~~ ( RAND AT ( NEXT TAN Y M[?]RNDU[?]RNDE[$]RND) ▞IVAL ▞RND[Y]4▘<7( RAND AT ( NEXT GOSUB #▚RNDTAN TAN TAN ▞ COPYVAL ▞~~ ( RAND AT ( NEXT TAN ............................................# ▀W▘ REM ..E[▒]RND#M[£]RNDE[$]RND▞KVAL ▞RND# RETURN.C: RETURN*C~~ RETURNXC▞ RETURN[X]C▝/▝Q 7( CONT AT ( LLIST TAN E[▒]RNDYT FASTSGN F[Y]CV77[Y]CQ▘Z ,,[Y]CJ[B]▘█ GOSUB PI[Y]CA STR$ LPRINT RETURNTC- RETURN[T]C~~ RETURN$C~~ RETURN C:/JY$/EXP Y /ASN Y[T]/LEN Y*/TAB RETURNTC, RETURN[T]C- RETURN$C> RETURN C▖ RETURN*C▌Y*>/[8]Y[▒]>/[3]Y*>U[£]RNDE[▒]RND#E[$]RND▞KVAL ▞RND# RETURN[▒]C▝/▝Q 7( POKE AT ( INPUT TAN .....E[$]RND▘ /-E[$]RND▘ ▞/:E[$]RND▘4 /▞E[$]RND▘4▞,, GOSUB #£RND<▞/VAL ▘4 GOSUB [K]<▘4 ,,AT ( PAUSE TAN ..E£RND7Y[▒]▞/VAL ▞4#7( UNPLOT 7AT ( PRINT TAN E£RND▘[$] ,, FASTSGN E[▒]RND▘▛▝[B] GOSUB PI▞(VAL ▘( GOSUB [K] FASTSTR$ LPRINT ▘) ,, FASTSGN LPRINT ▘K ,,AT ( DIM TAN ......# ▖>=▘ REM XX...................... ▗▖ ▗▟▙▖ ▐▐▌▌ ▛▜ ▗▌▐▖ ▗▖ ▗▟▙▖ ▐▐▌▌ ▛▜▖ ▗▌ ▗▖ ▗▟▙▖ ▐▐▌▌ ▗▛▜ ▐▖ ▄ ▗▄▛ ▐▐▛▘ ▛▀▌ ▛▘ ▀ ▄ ▗▛ ▐▌ ▗▟▌ ▝▐▖ ▄ ▜▄▖ ▝▜▌▌ ▐▀▜ ▀ ▝▜ ▄ ▜▖ ▐▌ ▐▙▖ ▟ ▘ ▗▄▗▄,,,,▝▜█ ▛▙▄ ▀▘▌▐▖ ▛▘ ,,,,▄▗▖ ▗▄▟▟▌ ▐▗▟▜ ▀▐▗▟ ▟ ▗▄,,,, ▌▄ ▙▛ ▗▄▟█▛▌▟ ▙▘ ▄ ▗▄█▄▖ ▐▒[▒]▒▌ ▐▀▌ ▟ ▙ ▄ ▛,, █[,,] ▐▀▜ ▐▀ ▝▘ ▄ ▛,, █[,,] ▄█ ▘▙ ▄ ,,▜ [,,]█ ▛▀▌ ▝▘ ▀▌ ▄ ,,▜ [,,]█ █▄ ▟▝ # ▌ACS ▘ REM XX.. ▄ ▗▄█▄▖ ▝▒[▒]▒▘ ▐▀▙ ▟ ▄ ▗▄█▄▖ ▝[▒]▒[▒]▘ ▟▀▌ ▙ ▄ ▗▄█▄▖ ▐▒█▒▌ ▐▀▙ ▟ ▄ ▗▄█▄▖ ▐[▒]█[▒]▌ ▟▀▌ ▙ ▗▞ ▚▖▐▄▟▙▄▌ [.][.] ▞▜▛▚ ▀ ▀ ▄ ▄ ▚▟▙▞ ██ ▐▀▜▛▀▌▝▚ ▞▘██▒█████████▒████▒█████████▒████▒█████████▒█[.][.]█▒█████████▒██ ███████[X][X][X][X]██[X][X][X][X]██[X][X][X][X]███████ .. THIS WAY [*]█[*]█[*]██[*]█[*]█[*][*]█▒[▒]▒██[*]█[*]█[*][*]█[*]█[*]██[*]█[*]█[*][*]█[*]█[*]██[*][▒]▒[▒][*][*]█[*]█[*]██[*]█[*]█[*]██ ██▀ ▀ ,,,,▄▙ ▄ ▘▄██ ██...# ▛>=▘ REM . ▖▗▖ ▌▟▙▖ ▛▜▌▌ ▛▜ ▗▌▐▖ ▄▗ ▗▄▛▐ ▐▐▛▜ ▛▀▌ ▛▘ ▀ ▄▗ ▗▄▛▐ ▐▐▛▜ ▗▟▌ ▝▐▖ ▖▄ ▌▜▄▖ ▛▜▌▌ ▐▀▜ ▀ ▝▜ ▖▄ ▌▜▄▖ ▛▜▌▌ ▐▙▖ ▟ ▘ ▖▗▖ ▌▟▙▖ ▛▜▌▌ ▗▛▜ ▐▖ ▖▗▖ ▌▟▙▖ ▛▜▌▌ ▛▜▖ ▗▌ ATN #E[▒]RND▘# ,, FASTSGN E£RND▘# ,,▞▖VAL FASTSTR$ LPRINT ▘ COPY [B] GOSUB PI FASTSGN LPRINT ▞▖VAL FASTSTR$ LPRINT #LN ~~#▘RND ,, FASTSGN LN [R]# GOSUB #[C]# LPRINT ▞▌VAL ▞▞VAL GOSUB #[C]#~~▀ GOSUB #[C]##7AT ( LIST ▘. ,,AT ( NEWAT (ACS ▘[:]▝[B] GOSUB PIAT ([N]TAN [B] RETURNPC+ RETURN[P]C) RETURNTC$ RETURN[T]C,, RETURNXC▌ RETURN[X]C▘TAN LEN █>TAN LEN █>TAN .......▞=VAL GOSUB #£RND<▞/VAL LN [/]RNDLN [O]RNDLEN ▖▞4><( UNPLOT =# RETURNTASN STEP # RETURN[T]ASN SLOW# RETURNPASN CONT # RETURN[P]ASN GOTO # RETURN[S]ASN LIST # RETURN[6]ASN # RETURNFASN POKE # RETURNGASN SAVE # RETURNHASN UNPLOT #▘ IF #TAN ▘/#TAN ▘Q#TAN ▘##TAN ▘Y#TAN ▘[/]#TAN ▘[Q]#TAN ▘USR #TAN ▘ PAUSE #TAN ▘##TAN ▘##TAN ▘##TAN ▘[▒]#TAN ▘CODE #TAN ▘ LLIST #TAN ▘~~#TAN ▘C#TAN ▘##TAN ▘##TAN ▘CHR$ #TAN ▘ POKE #TAN ▘>#TAN ▘K#TAN ▘##TAN ▘##TAN ▘[~~]#TAN ▘▙#TAN ▘[4]#TAN ▘##TAN ▘[(]#TAN ▘[Y]#TAN ▘>=#TAN ▘[I]#TAN ▘(#TAN ▘I#TAN ▘##TAN ▘[A]#TAN ......SQR COPY ▘▌▞ ▖▘~~▞,,5(#Q 7( CLS U># RETURN C?UPRND RETURN UNPLOT 4▒LN CONT PIY M>#U<# RETURN ASN ##UPRND RETURN RETURNTAB [1]#Y M<#LN THENRNDE[▒]RND FASTSGN ▘RND RETURN▖CH RETURN#CD RETURN~~CE RETURN#CA RETURN▒CB RETURN,,CE RETURN▞CA RETURN5ASN ## RETURNRNDC▞LN [A]####Y▘M-#TAN FY▘/?7Y▝/~~[B] GOSUB PIY▀/▀,,Y▖M*## RETURN█ASN M# RETURN ASN CODE # RETURN.ASN CODE # RETURN*ASN CODE # RETURNXASN ## RETURN[X]ASN ## RETURNTC1 RETURN[T]C; RETURNPCRND RETURN[P]CW RETURN[S]C# RETURN$C▀#B#Y▘M+#TAN GOSUB #[~~]RNDY$▝U(# RETURN▘4,,Q[S]Y M(#/▝Q█Y5>Y▘M)#LN THENRND RETURN 4 RAND #ACS # FASTLN [A]# LPRINT U$# RETURN C▝Q█5 COPY COPY6ORNDLN CONT PILN <#Y▘M>##ACS #LN [A]##EXP # FASTSTR$ LN [A]#SGN LPRINT U(# RETURN▘ASN EXP #U)# RETURN▘C$Q█YA>Y▘M(##▞#QTY M)# GOSUB #[~~]RND▝###Y▘M<#5 COPY COPY6ORNDLN STR$ #LN [*]#U£# RETURN▘ASN [1]# LN CONT PILN #PILN ###EXP # U)# RETURN▘C"U(# RETURN▘C▒Y1/▞Y5/▝YA>LN [E]#TAN U*# RETURN▝C# RETURN▀C# RETURN▖ASN ▗# U)# RETURN▘C-U(# RETURN▘C2, RETURN3C▌Y3#[8]#Y[3]#[8]#, RETURN7C▌Y7#[8]#Y[7]#[8]#, RETURNCC▌YC#[8]#Y[C]#[8]#U)# RETURN▘C-U(# RETURN▘C2, RETURN2C▌Y2#[8]#Y[2]#[8]#, RETURN6C▌Y6#[8]#Y[6]#[8]#, RETURNBC▌YB#[8]#Y[B]#[8]#U)# RETURN▘C-U(# RETURN▘C2, RETURN4C▌Y4#[8]#Y[4]#[8]#, RETURN9C▌Y9#[8]#Y[9]#[8]#, RETURNDC▌YD#[8]#Y[D]#[8]#U)# RETURN▘C~~U(# RETURN▘C STOP###, RETURN8C▌Y8#[8]#Y[8]#Y.>6[▒]RNDLN [*]#U=# RETURN▘COS #ACS # LN E#U/# RETURN▘COS LN [E]####[E]#LN [E]AT ###[V]#[£]#[G]#>#U COPY▐###INT # POKE #[8]#[7]#*##### RUN # LOAD COPY NEW#▟#▞#D#?#[?]#M#D#[K]#;# NEW#T COPYSQR #U COPY£#Z## COPY+# CLEAR COPY[/]#[£]#[N]#.#AC2Y.>6[▒]RND▞▛VAL QFLN ##QXLN ##QGLN ##Q[X]LN ##QHLN ##QXLN ##AT ( THEN/▞ FASTLN [E]# LPRINT TAN U(# RETURN C4Q1 FASTSGN #5STR$ #[Y]C▖77/ RAND 7#[Y]C▖7#/ LIST Q COPYY M(#TAN FASTLN [>]RNDLN [O]RND LPRINT RETURN▘CUSR RETURN▀CSQR QX▞;VAL LN ##AT ( RAND Y▘M/#TAN UC##VAL LN £#Q[S]AT ( RUN UD##VAL LN £#Q[P]AT ( RUN 5STR$ #UB##VAL FASTLN B## RETURN 4 SAVE F# RETURN▒C PAUSE 77# RETURN▒C FOR LPRINT #7#7AT ( LPRINT UB##)STR$ #,#<,#< RETURN COPYC"# RETURN[X]C▖QX/▝Q[X]( DIM TAN LN B## RETURN█4 POKE F# RETURN▒C INPUT 77# RETURN▒C SCROLLFTAN U[(]RNDWM[(]RND RETURN[H]ATN [>]RNDLN [/]RND- #STR$ LPRINT ▞~~;( CLEAR GOSUB #[$]RND;)█ ; FASTSGN TAN ......... LN SCROLL#U£# RETURN▘ASN B#Y MA#UB##VAL 5STR$ #UA#▞ #WWMA#,,#7# FAST# RETURN COPYC#STR$ LPRINT FLN ▀#C#77LN ▀#C#U## RETURN▘CZU[(]RNDWM[(]RND RETURN OR ATN $#LN [/]RNDLN [O]RNDSTR$ LPRINT RETURN▝C" RETURN▀C~~ RETURN▖C£F/?7/£▘RND ,,/▞▘RND [B] GOSUB PI# RETURN.C6 RETURN*C2 RETURN C, LPRINT AT ([:]#B#Y M<# FOR LN E#U/# RETURN C DIM LPRINT AT TAN QXY > FASTSGN LPRINT #F#/ AND FAST GOSUB #[▒]RND[B] GOSUB PI LPRINT TAN Y M[(]RNDLN [>]RNDTAN Y M[(]RNDLN [>]RNDTAN ....Y█E[$]RND▘ COPY▖,,#7Q[S]▘# ,,#7#LN ##6[▒]RNDY # FASTSGN F[Y]C3LN ##[Y]C*LN ##[Y]C)STR$ LPRINT F/ CONT ▘RND [B] GOSUB PITAN ▘█ ,,TAN 7#E[▒]RND# FASTSGN 7[Y]C7=▘K ,, FAST FOR ▘) ,, FOR LPRINT AT (ASN TAN LPRINT Y█>/ FAST.......... 2 REM 3 REM 4 REM MAZOGS (C)1981 BUG-BYTE 5 REM AUTHOR: DON PRIESTLEY 6 REM 7 REM 8 REM 108 LET MST=29450 110 LET MDR=6100 112 LET BB=6030 114 LET SUR=6052 116 LET C=2 120 LET POKE=6000 122 LET INK=6060 124 LET T=2000 126 LET PR=6070 128 LET CT=6080 198 POKE 19273,254 200 LET AD=16525 202 LET N=MST 204 GOSUB POKE 206 POKE 19217,0 208 FOR A=19892 TO 19894 210 POKE A,0 212 NEXT A 214 POKE 17370,136 216 POKE 18810,0 250 GOTO 2000 1000 LET TD=PEEK 18810+PEEK 18811*256 1002 IF PEEK TD=57 OR PEEK TD=185 THEN POKE TD,151 1006 LET POS=PEEK 16520+256*PEEK 16521 1010 LET X=MST 1020 POKE 16525,X-INT (X/256)*256 1022 POKE 16526,INT (X/256) 1030 RAND USR 17310 1040 LET K$=INKEY$ 1050 LET X=X+(K$="J")-(K$="H")+(K$="S")*64-(K$="W")*64+(XMST+1568)*64 1052 IF K$="P" THEN GOTO 1100 1054 IF K$="0" THEN GOTO 1200 1056 IF K$="G" THEN RUN 1060 GOTO 1020 1100 PRINT AT 0,8;"█████SOLVING████" 1104 POKE TR,57 1106 GOSUB 1250 1110 RAND USR 17128 1114 RAND USR 17171 1116 GOTO 1210 1200 GOSUB 1250 1206 RAND USR 17128 1210 RAND USR 20199 1212 POKE POS,8 1220 GOTO 1020 1250 LET AD=16525 1252 LET N=MST 1254 GOSUB POKE 1258 LET AD=16520 1260 LET N=HM 1262 GOSUB POKE 1264 POKE POS,0 1266 RETURN 2000 SLOW 2004 POKE 16677,128 2006 RAND USR 16672 2007 POKE 16518,8 2008 RAND USR 16620 2010 LET AD=16520 2012 LET N=MST+470 2014 GOSUB POKE 2016 POKE N-130,33 2017 POKE N-129,57 2018 POKE N-66,27 2019 POKE N-65,27 2020 POKE N-64,39 2021 POKE N-63,61 2022 POKE N-1,23 2023 POKE N,53 2024 POKE N+1,0 2025 POKE N+65,184 2026 POKE N+63,23 2027 POKE N+62,189 2030 GOSUB SUR 2031 GOSUB PR 2032 PRINT AT 1,6;"A MAZE ADVENTURE GAME" 2034 GOSUB 2046 2036 PRINT AT 1,6;"[P][R][E][S][S]█[A]█[K][E][Y]█[T][O]█[S][T][A][R][T][▒]" 2038 GOSUB 2046 2040 GOTO 2032 2046 FOR A=4 TO 21 2050 GOSUB PR 2054 PRINT AT A,25;"MAZOGS" 2063 IF INKEY$ <>"" THEN GOTO 2080 2064 NEXT A 2066 POKE 18619,5 2068 GOSUB PR 2070 POKE 18619,4 2072 RETURN 2080 POKE 18619,5 2081 GOSUB BB 2082 POKE N-128,189 2084 LET X=USR 18602 2086 PRINT AT 1,10;"WHICH GAME ?" 2088 PRINT AT 10,5;"1. TRY IT OUT" 2090 PRINT AT 12,5;"2. FACE A CHALLENGE" 2092 PRINT AT 14,5;"3. MANIAC MOBILE MAZOGS" 2094 PRINT AT 18,5;"PRESS NUMBER TO CHOOSE" 2096 GOSUB INK 2098 LET K$=INKEY$ 2110 IF K$="1" THEN GOTO 2150 2112 IF K$="2" THEN GOTO 2200 2114 IF K$="3" THEN GOTO 2250 2116 GOTO 2080 2152 GOSUB BB 2154 POKE N-128,35 2155 RAND USR 18602 2156 PRINT AT 1,11;"TRY IT OUT" 2162 GOSUB MDR 2166 POKE 19212,1 2168 POKE 19213,0 2170 POKE 19892,205 2171 POKE 19893,109 2172 POKE 19894,66 2174 GOTO 3000 2202 GOSUB BB 2204 POKE N-128,39 2206 GOSUB PR 2208 PRINT AT 1,8;"FACE A CHALLENGE" 2216 GOSUB MDR 2220 POKE 19212,0 2222 POKE 19213,0 2223 POKE 20310,1 2224 GOTO 3000 2250 PRINT AT 1,6;"MANIAC MOBILE MAZOGS" 2254 POKE N-128,29 2256 POKE N-129,61 2258 POKE N-127,61 2260 FOR A=1 TO 10 2262 GOSUB PR 2264 NEXT A 2269 GOSUB MDR 2270 POKE 19212,0 2272 POKE 19213,1 2276 POKE 20310,0 2278 POKE 19273,253 2280 GOTO 3000 3000 GOSUB SUR 3002 RAND USR 20631 3010 RAND USR 19226 3012 IF PEEK 19220 THEN GOTO 3100 3014 IF PEEK 19221 THEN GOTO 3150 3020 IF PEEK 19222 THEN GOTO 3060 3026 GOSUB 6037 3030 FOR A=1 TO 40 3031 RAND USR 18602 3032 PRINT AT 18,1;"[D][E][A][T][H]██[T][O]█[A][L][L]█[T][R][E][A][S][U][R][E]█[S][E][E][K][E][R][S]" 3034 NEXT A 3040 GOTO 3200 3060 GOSUB 6450 3062 IF P$<>"T" OR PEEK 19217 OR PEEK 19216 OR K$="1" THEN GOTO 3070 3064 LET N=INT (ML/2)+1 3065 IF N<=2 THEN GOTO 3070 3066 GOSUB POKE 3068 POKE 19216,1 3070 GOSUB SUR 3072 RAND USR 20631 3074 RAND USR 19239 3076 GOTO 3012 3100 POKE 17370,128 3116 GOSUB SUR 3118 FOR A=1 TO 35 3120 PRINT AT 10,4;"YOU HAVE STARVED TO DEATH" 3122 PRINT AT 10,4;"[Y][O][U]█[H][A][V][E]█[S][T][A][R][V][E][D]█[T][O]█[D][E][A][T][H]" 3124 NEXT A 3140 GOTO 3214 3160 IF D$="L" THEN GOTO 3180 3162 POKE HM,29 3164 POKE HM+1,33 3165 POKE HM-64,0 3166 GOSUB PR 3168 PRINT AT 10,8;"EXIT" 3170 FOR A=1 TO 60 3172 PRINT AT 18,7;"[W][E][L][C][O][M][E]█[B][A][C][K]" 3174 PRINT AT 18,7;"WELCOME BACK" 3176 NEXT A 3178 GOTO 3200 3180 POKE HM,29 3182 POKE HM-1,33 3184 POKE HM-64,0 3186 GOSUB PR 3188 PRINT AT 10,20;"EXIT" 3190 FOR A=1 TO 60 3192 PRINT AT 18,13;"[W][E][L][C][O][M][E]█[B][A][C][K]" 3194 PRINT AT 18,13;"WELCOME BACK" 3196 NEXT A 3200 GOSUB SUR 3216 IF K$="1" OR NOT PEEK 19221 THEN GOTO 4500 4000 PRINT AT 4,13;"[S][C][O][R][E]" 4030 PRINT AT 7,C;"MOVES ALLOWED = ";MA 4031 PRINT 4034 LET ML=PEEK 19214+PEEK 19215*256 4038 PRINT "[▒][▒]MOVES LEFT = ";ML 4040 PRINT 4046 PRINT "[▒][▒]SCORE = ";INT (ML/MA*100);" PER CENT" 4500 PRINT AT 18,C;"PRESS ""M"" TO EXAMINE THE MAZE" 4520 PRINT AT 20,C;"PRESS ""G"" FOR ANOTHER GAME" 4522 GOSUB INK 4524 LET K$=INKEY$ 4530 IF K$="M" THEN GOTO 1000 4532 IF K$="G" THEN RUN 4534 GOTO 4524 6010 POKE AD,N-INT (N/256)*256 6020 POKE AD+1,INT (N/256) 6024 RETURN 6032 LET AD=16520 6034 LET N=MST+480 6036 GOSUB POKE 6037 POKE 17370,128 6038 GOSUB SUR 6040 RAND USR 18602 6041 POKE 17370,136 6042 RETURN 6052 LET X=USR 17365 6054 RETURN 6062 IF INKEY$ <>"" THEN GOTO 6062 6064 IF INKEY$ ="" THEN GOTO 6064 6066 RETURN 6072 LET X=USR 18602 6074 RETURN 6082 LET X=USR 17128 6083 LET X=USR 17171 6084 POKE 16527,23 6085 LET X=USR 17028 6086 LET X=USR 17128 6088 LET MOVES=PEEK 16518+PEEK 16519*256 6089 RETURN 6110 PRINT AT 14,C;" USE KEYS W A D AND X OR " 6112 PRINT AT 16,C;" W S H AND J. V=VIEW,Y=STOP" 6114 PRINT AT 21,C;"[T][H][E]█[M][A][Z][E]█[I][S]█[N][O][W]█[B][E][I][N][G]█[D][R][A][W][N]█" 6124 POKE 16677,128 6126 RAND USR 16672 6130 POKE 16518,8 6132 RAND USR 16620 6141 RAND 6142 LET N=MST+128+INT (RND*2810) 6144 IF PEEK N=8 OR PEEK (N+1)=8 OR PEEK (N-1)=8 THEN GOTO 6142 6146 LET AD=16520 6148 GOSUB POKE 6150 POKE N,57 6152 LET TR=N 6153 POKE 16437,INT (RND*120)+132 6155 LET X=USR 16694 6157 IF PEEK 16518+PEEK 16519*256>1200 THEN GOTO 6170 6158 PRINT AT 21,C;" THE MAZE IS BEING REDRAWN " 6160 GOTO 6120 6170 RAND USR 20515 6172 LET X=USR 20133 6298 PRINT AT 21,C;" MAZE READY - PRESS ANY KEY " 6300 GOSUB INK 6310 GOSUB SUR 6314 RAND USR 20860 6316 PRINT AT 2,1;"WHICH WAY ? PRESS ""L"" OR ""R""" 6318 LET N=PEEK 16520+PEEK 16521*256 6319 LET HM=N 6320 LET AD=16522 6322 GOSUB POKE 6324 GOSUB INK 6334 LET D$=INKEY$ 6336 IF D$="R" THEN GOTO 6346 6338 IF D$="L" THEN GOTO 6350 6340 GOTO 6324 6346 POKE N-1,128 6348 GOTO 6360 6350 POKE N+1,128 6360 GOSUB SUR 6362 RAND USR 20860 6364 PRINT AT 21,C;"PRESS ANY KEY FOR INFORMATION" 6366 GOSUB INK 6392 GOSUB SUR 6394 PRINT AT 10,7;"CHECKING DISTANCE" 6398 GOSUB CT 6410 IF MOVES>120 THEN GOTO 6440 6412 POKE TR,0 6414 LET N=MST+128+INT (RND*2810) 6416 IF PEEK N<>0 THEN GOTO 6414 6418 LET TR=N 6420 POKE TR,57 6422 GOTO 6396 6440 LET N=MOVES*4+10 6441 LET MA=N 6442 LET AD=19214 6443 GOSUB POKE 6444 LET X=INT (MOVES/5*VAL K$) 6445 IF X>255 THEN LET X=255 6446 POKE 18779,X 6448 POKE 19225,30/VAL K$ 6452 GOSUB SUR 6456 PRINT AT 2,7;"[S][I][T][U][A][T][I][O][N]█[R][E][P][O][R][T]" 6458 GOSUB CT 6470 IF NOT PEEK 19217 THEN PRINT AT 5,C;"MOVES TO THE TREASURE = ";MOVES 6472 IF PEEK 19217 THEN PRINT AT 5,C;"MOVES BACK TO ""BASE"" = ";MOVES 6474 IF K$="1" THEN GOTO 6500 6476 LET ML=PEEK 19214+PEEK 19215*256 6477 IF ML>11 THEN LET ML=ML-10 6478 PRINT AT 7,C;"YOU HAVE ";ML;" MOVES TO GO" 6480 IF ML>=MOVES THEN GOTO 6489 6482 LET X=INT ((MOVES-ML)/PEEK 18779)+1 6484 PRINT AT 9,C;"YOU NEED TO KILL AT LEAST" 6485 PRINT AT 10,C;X;" MAZOG"; 6487 IF X>1 THEN PRINT "S"; 6488 PRINT " TO GET THERE" 6489 PRINT AT 13,C;"YOU GAIN ";PEEK 18779;" FOR A ""KILL""" 6490 PRINT AT 15,C;"YOU LOSE ";PEEK 19225;" FOR EACH ""VIEW""" 6492 PRINT AT 17,C;"THIS REPORT TAKES 10 MOVES" 6494 LET N=ML+1 6496 GOSUB POKE 6498 PRINT AT 19,C;"PRESS T TO ""BUY"" A SWORD" 6500 PRINT AT 21,C;"PRESS ANY KEY FOR THE GAME" 6502 POKE 19222,0 6504 GOSUB INK 6506 LET P$=INKEY$ 6999 RETURN 9000 CLEAR 9010 PRINT USR 8192;"SAVE:P:MAZOGS:" 9020 RUN ```