--- title: "3D Monster Maze" id: 51859 type: "computer_media" slug: "3d-monster-maze" url: "http://localhost/computer_media/3d-monster-maze/" markdown_url: "http://localhost/computer_media/3d-monster-maze.md" published_at: "2023-08-16T01:42:19+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 3D maze while a Tyrannosaurus Rex hunts you down — a landmark first-person game driven almost entirely by machine code beneath a BASIC shell." category: - name: "Archived Media" slug: "archived-media" taxonomy: "category" url: "http://localhost/category/archived-media/" post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "J. K. Greye Software" slug: "j-k-greye-software" taxonomy: "post_tag" url: "http://localhost/tag/j-k-greye-software/" - 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/3D Monster Maze (1983)(J.K. Greye Software)(UK)(TS1000)(Cassette).zip" mediadate: "1983" producer_company: - id: 10969 title: "J. K. Greye Software" type: "company" url: "http://localhost/company/j-k-greye-software/" related_products: - id: 11589 title: "Gamestape 4: 3-D Monster Maze" type: "product" url: "http://localhost/product/3-d-monster-maze/" media_type_tags: "Game" --- 3D Monster Maze is a first-person perspective maze game in which the player must navigate a randomly generated labyrinth while being hunted by a Tyrannosaurus Rex. The program uses extensive machine code routines called via USR, with the BASIC acting primarily as a control shell that initializes parameters and responds to game-state flags stored at fixed memory addresses (notably 16514–16523 and 17901). Maze generation is handled in machine code, with the BASIC seeding the process by POKEing random values into key locations and looping until a sentinel value (255) appears at address 16514. The game features multiple distinct display states for the dinosaur’s proximity, rendered as block-graphic images stored in REM statements at the top of the listing, and tracks a persistent score across maze resets. A SLOW/FAST toggle is used deliberately around display-intensive sections to manage rendering speed. *** ## Program Analysis ### Program Structure The program is organized into a BASIC shell that orchestrates machine code routines, with the bulk of the actual game logic residing in machine code called via `USR`. The BASIC lines fall into several functional blocks: - **Lines 0 (REM blocks):** Multiple large `REM` statements at the start of the listing store machine code and pre-rendered block-graphic images for the dinosaur at various distances, the title screen, the “you escaped” screen, the “you died” screen, and the introduction text. - **Lines 95–97:** Entry point — `RAND` to seed the RNG, then `GOTO 1015` to skip the save line. - **Lines 100–440:** Main gameplay loop. Maze generation is seeded, machine code routines are called in sequence, and player input is read and dispatched. - **Lines 1000–1170:** Initialization and title sequence, including the `SAVE` command and the intro animation loop. - **Lines 2000–2640:** Game restart and transition sequences, including maze regeneration and the `FAST`/`SLOW` transition. - **Lines 3000–3030:** Delay subroutine with a display-sync guard using `PEEK 21627`. - **Lines 4000–4050:** Parameterized pause loop that calls the display routine `S+1` times. - **Lines 5000–5160:** Death/escape handler, including the randomized appeal mechanic. - **Lines 6000–6040:** POKEs four consecutive memory locations (17718–17721) to the value 28, apparently resetting a display or score buffer. ### Machine Code Interface The game makes heavy use of `USR` calls to machine code routines embedded in `REM` statements. The return values are discarded via assignment to `A`. The key entry points identified by their addresses are: | Address | Purpose (inferred) | | --- | --- | | `17441` | Initial setup / first-call initialization | | `17461` | Maze generation step (called in loop until `T>=800`) | | `17617` | Maze validation / completion check | | `17683` | Dinosaur state / proximity update | | `18224` | Main game frame render/update (called each move) | | `18288` | Initial 3D view render | | `21809` | Intro/transition animation frame | | `21829` | Transition completion step | | `21836` | Intro animation continuation frame | ### Maze Generation Maze generation is driven by a loop at lines 120–220. The BASIC repeatedly POKEs a random direction (0–3) to address `16514` and a random step count (0–5) to `16516`, accumulating a total step count in `T`. A bias toward direction 2 is applied when `PEEK 16514 < 16` with 90% probability (line 130), which likely keeps the maze generator from getting stuck near boundaries. The loop continues until `T >= 800`, ensuring a sufficiently complex maze. After generation, the program POKEs random values to `16514` and calls `USR 17617` until address `16514` returns 255, signaling that a valid exit has been placed. ### Memory-Mapped Game State Communication between BASIC and machine code is entirely through fixed memory addresses. Key locations include: - `16514` — multi-purpose: direction during generation, completion flags (255 = done), player state flags (>=128 = caught) - `16515` — parameter byte (set to 162, 224, or 70 for different phases) - `16516` — step count / movement parameter - `16517` — direction input to maze generator - `16519` — state flag checked for catch condition (>=128) - `16522` — player keypress, written as `CODE INKEY$` - `16523` — initialized to 8 - `17901` — randomized each frame with `INT(RND*128)`, likely used as a noise/animation seed ### Input Handling Player input is read via `INKEY$` in a tight loop (line 320). The keypress character code is written to `16522` via `CODE INKEY$`, and the machine code routine at `18224` processes movement. The keys 5 (turn left), 7 (move forward), and 8 (turn right) are described in the intro text. At the title screen, keys `K`, `A`, and `C` branch to different game states (start, `NEW`, or continue). ### Display and Animation The 3D view images for different dinosaur proximity states are stored as block graphics in the opening `REM` statements. The `SLOW` mode is engaged at line 240 before the main game loop to improve display quality, and `FAST` is restored at line 2630 before maze regeneration. A display synchronization guard at line 3020 checks `PEEK 21627 <> 170` and POKEs `16389` to 68 if needed — this is a known technique for synchronizing with the display interrupt. Address `21623` is checked at line 335 to conditionally zero out a byte in the display file, calculated as `(PEEK 16396 + 256*PEEK 16397) + 66`, which dereferences the display file pointer dynamically. ### Scoring and Death The score display is positioned at line 250 (`AT 9,27`). On death (line 5000), the game checks whether the player was eaten versus escaped by examining bits of `PEEK 16520`. The appeal mechanic at lines 5050–5140 gives a 50% chance of `NEW` (total reset) versus returning to the game via `GOTO 235`. If the player escapes, lines 2520–2640 regenerate the maze while preserving the score, with `RAND` at line 2636 re-seeding the RNG before jumping back to line 100. ### Notable Techniques and Anomalies - Line 1065 uses `GOTO USR (PEEK 16510)` — a computed `GOTO` that jumps to a line number returned by a machine code routine, used as a self-modifying dispatch mechanism. - The `SAVE` at line 1010 is placed inside the program flow at a line only reached on first run, so saving captures the initialized state. - Line 335’s dynamic display file address calculation (`PEEK 16396 + 256*PEEK 16397`) reads the system variable D_FILE, making the code robust to memory layout changes. - The subroutine at line 6000 POKEs four consecutive score-display bytes to 28 (the character code for “0”), effectively resetting displayed score digits after transitions. - The parameterized delay subroutine at line 4000 uses variable `S` set before each call to control the number of display update iterations, providing different animation speeds for different game phases. ## Source Code ``` 0 REM $W#▘▖▝##7▒▘▛#COS #NPI DIM PI=INKEY$ [=]INKEY$ SRND CLEARRND OR RND""RND[I]RND[A]PI LPRINT ▘#▘█4▘█ ▘#▘▄3▝▗█3▀▗█▌2▝▝▘ ▘P▝▗▄3▝▝▛3▀█▟▙2▀▜█▞2▀▀▀▙ ▘P▀▐█▖2▀▝█▘1▖▗█▄▌1▖▐▜█▙2▀███1▌▗█▛▀▘ ▘=▀▟█▙1▖▐▙█▟1▖▝▞▀▚1▌▐█▄█▌0▌▝████0▌▗███▌0▌████▌.▞▗▟▌▀█▌3▝▀▀ ABS ▀▗▄▄2▖▛█▛▌0▌▗███▌0▌▐▖▀▘▙0▞█▙ ▟█▖,▛▗█████▌,▛▐▌███▛ ,▛▝▐████▖.▞██████.▞███▌▟█.▛▜█▐█▜█▄;▀▄█▌ [K]▖▗██▙1▌████▌0▌█▟█▙▌.▛▐▝██▛▟ ,▛▟▌▝▀▗█▌,▛██▖ ███,▒▜████▌█▌;▒ ████▙▝█;▒▟█████▙▀/▒▟███████;,,██▜██▛██▌/,,▜█ ▜█▟██▘*~~▄█▛ ▝█▌█▛ 2▀▜▙▖ #▖▄▄▄▖0▞▟████▌,▛▐██████,▛▐▙▐██▖▛;,,▗▛██████▖*~~ ██▝█▟▟▛█▙*~~▐██▖▝▀▀▗██*~~▟███ ▟██-"▗█▌██▙▄▟██▛-"▐▛▐███████▘-"▐▘▟███████▌*" █████████▖-"▗██████████-"▐█████▌▜██▛-" █████████▌*~~▐█▛▐█▛▚██▖+£▗▄██▌ ▀ ▝▀▀▀+▌▝▀▀▀ ▘#▘▄4▘▀ #▞▗▄▄▄▄▖,▒▗██████▖/~~▗████████ -" ▟█O████O█▌-" █████████▌-"▗████▜▛███▌+$▗██[,,]██████[,,]▙ <: ██▌~~VV[,,][,,]VV[▒]█▌?▐███[▒] [▒]███▖>?▐███[~~][▒] [▒]███▌>? [,,]███[▒],, ,,[~~]███▌>( [~~][,,]███[~~][▒][▒][~~]████▙ )( ▜[~~][,,]████████[▒]██ >?▝█[~~]████████[▒]██ >? ▜██▛██▌▟██[▒]██ <:▐██▌███████[▒]▛ )?▗▄███▌▐██▛▐██▌ >?▐███▛ ▀▘ ▐██▙▖0▞ ████▖0▌▝▀▀▀▘ ▖(▘ REM 5 LIST #▘3▘) LET #Q█ GOSUB [K]5 COPY#6▙RNDTAN U▜RND#)( E▙RNDU▐RND RETURN ASN ## RETURN▘ASN [.]# RETURN▝ASN ## RETURN▀ASN ##TAN 7Y?[9]4#TAN ;Y LIST [9]4~~TAN Y LIST [9]4▘TAN [B] GOSUB ## RETURN C0Y?[9]C~~F# RETURN 4▀TAN /[S]77Y?[9]C▞# RETURN 4▘TAN FY 6▙RND FOR >([5]PI#TAN # NEW? RETURN▘4▘TAN F# RETURN C2Y LIST [9]C~~[B] GOSUB ## RETURN 4▘TAN ;;Y LIST [9]C▞# RETURN 4▘TAN [B] GOSUB #6▙RND FOR Y >([J]TAN 5K#U▙RND▐## RETURN ""QHLN ##: LN ▖#)? LN ▖#)▝ LN ▖#)? LN ▖#5 COPY#Q 5▙RNDQ COPYTAN ;# RETURN 4▒ACS INKEY$ C▝Q█:▘TAN 5▌#▞▞ACS #C,,7( RAND ▘~~ ,,/ LET 6[▒]RNDQM#[>]# ▌ RUN ▘ REM 0000 ▝ ▌ REX LIES IN WAIT [R][U][N] HE IS BEHIND YOU [R][U][N] HE IS BESIDE YOU REX HAS SEEN YOU FOOTSTEPS APPROACHING HE IS HUNTING FOR YOU V["]/WXBIV[C]SG# █████████████████ █ ██M████████ █ ▒ ██ █ █ ██▒███ ████ █▒▒▒▒▒▒███ █▒█▒██▒███H████ █▒█▒██▒████████ █▒ ▒ ▒▒▒▒▒████ █▒█▒██▒███▒▒▒▒ █▒█▒██▒▒▒▒██▒██ █▒▒▒▒▒▒██▒██▒██ █ █▒██ ██▒██▒██ █ █▒██ ██▒██▒██ █ ▒▒▒▒▒▒▒▒▒▒ █ █ ██ ██ ██ ████ █ ██ ██ ██ █ ███ ████████████████ ▛#▞ REM 5▗RNDU[~~]RND RETURN 4,,ACS INPUT ACS ####/H RETURN74▖ACS PLOT /5 RETURN54£U▜RNDW RETURN▖4>Y /: RETURN84<=U▜RND RETURN 4▝Y▖XM▜RNDACS [I]ACS [Y]E▙RND# RETURNHASN J#Y M[£]RNDY▛M[$]RNDLN ##LN O#U▜RND RETURN 4▒) LIST COPY▘▘ /5 RETURN▘4▒) COPY COPY▘ LIST COPY/+ RETURN▝4▒)( ▘ COPY COPY/,, RETURN▀"")▘ ▘( 5▗RNDACS #E▙RNDTAB TO #U▗RNDACS #C:;ACS #ASN OR #ACS [R]M▗RND# POKE #U▗RNDACS [B]M▗RND6▙RNDSTR$ VAL FAST,,▘ ▘ GOSUB #▐RNDLN ▜# LPRINT AT FAST[B] GOSUB PIVAL LN ▖#▘▘▖ GOSUB #▐RND5[£]RNDOAT LPRINT SGN ;ACS #TAB PLOT #U[▒]RND[X]4▞U[£]RNDM[$]RND# RETURNH4▒U▗RNDACS SCROLLM▗RNDSTR$ VAL FAST,,LN ▜# LPRINT AT FAST[B] GOSUB PIVAL LN ▖#U▚RND#([Z]▞▘# RETURN£S[S]SGN LPRINT SGN ; FASTE£RNDVAL ▘$ ,,)5 ▞*Q ;( CLSAT E£RND)#▘;SGN FOR ACS #4£Y▄>55 ;Q▀#▗#Y,,>55 ;Q~~#▗# GOSUB #▐RNDACS #4PE£RNDY;[)]#- ;)5 # RETURN #▞*4▘▖Q ;( CLS## RETURN"C▖£(>=TAN E£RND)#▘;)5 Q,,;Q~~TAN VAL ); E£RND;)5 Y-INKEY$ ACS 4[(]▞ [B] GOSUB PIINKEY$ PRINT # RETURN C▌Q ;( CLS LET Q▟# RETURN C▌;Q█( CLS;Q▜# RETURN▝S▛#▌;Q ( CLSAT £([Y]TAN GOSUB #▐RNDACS #4X- #E£RND7;)5 # RETURN #▞*4▘▖Q ;( CLS## RETURN"C"£( THEN GOSUB #▐RND#▟#TAN E£RND)#▘;)5 Q,,;Q~~▘£ TAN VAL )5 E£RND7Y-INKEY$ ACS 4[(]▞ ,,INKEY$ PRINT # RETURN C▌Q ;( CLS LET Q▙# RETURN C▌;Q█( CLS;Q▛INKEY$ # RETURN▝S▞▌;Q ( CLSAT £(#TAN ▘£ E£RND,,▞▘)#▘;)5 [B] GOSUB #F$C3# RETURN C▖▞▘/ LIST Y$[)][(]ACS BVAL FAST;( CLEAR#Q▒;( CLS LPRINT AT ▖/ AND E£RND)#▘;▘£▘)5 [B] GOSUB #7$4▞LN O## POKE ## RETURN C▖▞▘/ REM Y$[)][(]ACS BVAL FAST;( CLEAR#Q▒;( CLS LPRINT AT ▖/USR E£RND7)5 GOSUB #▐RND▞ ,,Y;INKEY$ ACS 4[(]#CHR$ ▘VAL FASTINKEY$ Q ;( CLS#Q▒;( CLSINKEY$ ▌C▌Q ;( CLS LPRINT 7AT ( SLOWU▗RNDACS #CODE J##▗#E▙RNDU[▒]RND[X]"" LET Y M[$]RNDU▗RNDACS #ASN POKE #ACS COPYM▗RND# POKE #5▗RND#ACS #4▝ACS SIN WACS #4▝#TAN NEW LIST #5▙RNDY GOSUB ## GOSUB ## GOSUB #5[▒]RND GOSUB ##VAL GOSUB ##STR$ GOSUB ##[T]K▖#[(]/▘[)]##[V]K▖#[>]/▘[<][T]SGN AT USR [4]#>=[Y]#>=[4]#TAN E[▒]RND#VAL ▘( [V]K▌[B] GOSUB PI/▀C,,,,AT ACS #R""[B]//AT RTAN E[▒]RND#[T]K▀F/▀C▛7ACS #R""/▝RTAN 6[▒]RNDACS THEN5▗RNDACS THENSGN TAN ▞ U[▒]RND/▛;ACS #TAB [>]#▖[X]4 PLOT #M[$]RNDU[$]RND RETURN▞ABS [>]#)[:]RND5▗RNDACS BACS BACS #4▀I▝▐#A ;#7# FOR #7 GOSUB #£RND FOR , RETURN ASN [N]##,,<,▞ #< FOR GOSUB [K]/ GOTO U GOSUB # RETURNRNDS▝LEN RNDM GOSUB #5 STOP#) LLIST #▘£ GOSUB [K] GOSUB #▐RND▞ Y£[)]ACS B# RETURN▖** GOSUB #£RND5[;]▘;) GOTO #,#.STR$ ,▖▖VAL F)5 [B] GOSUB #7#( UNPLOT AT ▌VAL ;#( UNPLOT AT ▖VAL F#( UNPLOT AT ▌VAL [B] GOSUB ##( IF AT ▖SGN #[T]SSGN TAN U▗RNDACS #445["]RNDY▒[Y]C▘O) #[K]#ACS #COS JWTAN Y GOSUB ## GOSUB ## GOSUB #TAN 5[▒]RNDLN [I]#VAL SGN 5▙RNDLN [I]##[>]##[<]# RETURN 4C#LN [C]# RETURN▛K#VAL LN ##AT #LN [C]# RETURN▀K#U▜RNDACS #4▞)- #[K]#)G #[K]## RETURN 4C#LN [C]# RETURN▛K4VAL LN ##AT #LN [C]# RETURN▀KYU▜RNDACS #C▞)- #[K]#)G #[K]##LN [C]###LN [C]#█ RETURN,,S)U["]RND RETURN C(XM["]RND)# #[K]#)# #[K]#)▜ #[K]#)PI #[K]## RETURN C>LN [C]#ACS ##C▌)( /-) LIST COPY/)#LN [C]#ACS ##C▌)▘ /▀) COPY COPYE▙RND;ACS #4▀( RAND TAN SGN AT #A## RETURN#C,, RETURN C▌Y M["]RND5PI#; FOR E£RND▘ RAND ▝,, FOR ▘- GOSUB [K]TAN LN [?]#5▗RNDY#[A] RETURN#ACS [Q]4▞)INKEY$ #LN $#5▗RNDACS #C▌)[$]▘/2E▙RND# RETURNH4▒)X#LN $#/#U[$]RND### RETURN▞>=[1]#)#▘E£RND; FOR 5Q#▞▖# RETURN04▒Y >7<( POKE TAN #>7<( IF TAN 5T#▞▖[B],[:]. RETURNAS▒CHR$ ~~#FR( PAUSE TAN #F[B]( GOTO TAN E£RND)W ;)[E]# FOR ▞~~▞ REM ROLL UP,ROLL UP, SEE THE AMAZING TYRANNOSAURUS REX KING OF THE DINOSAURS IN HIS LAIR. PERFECTLY PRESERVED IN SILICON SINCE PREHISTORIC TIMES,HE IS BROUGHT TO YOU FOR YOUR ENTERTAINMENT AND EXHILARATION. IF YOU DARE TO ENTER HIS LAIR,YOU DO SO AT YOUR OWN RISK. THE MANAGEMENT ACCEPT NO RESPONSIBILITY FOR THE HEALTH AND SAFETY OF THE ADVENTURER WHO ENTERS HIS REALM.THE MANAGEMENT ADVISE THAT THIS IS NOT A GAME FOR THOSE OF A NERVOUS DISPOSITION. IF YOU ARE IN ANY DOUBT,THEN PRESS [S][T][O][P] IF INSTRUCTIONS ARE NEEDED TO PROCEED, THEN PRESS [L][I][S][T] OTHERWISE PRESS [C][O][N][T] THE ONLY CONTROLS YOU REQUIRE ARE:- 5....TURN LEFT 7....MOVE FORWARD 8....TURN RIGHT FURTHER INFORMATION IS PROVIDED DURING THE ENCOUNTER. FOR EACH MOVE SCORING IS AS FOLLOWS 5 PTS-WHILE HE IS TRACKING YOU. 200 PTS-IF YOU ESCAPE HIS LAIR. SINCE REX IS ALWAYS TRYING TO MOVE TOWARDS HIS PREY,A SKILFUL ADVENTURER CAN CONTROL THE MONSTERS MOVEMENTS TO IMPROVE HIS SCORE. THE ESCAPE ROUTE, WHICH IS AT THE END OF A CUL-DE-SAC,IS VISIBLE UP TO 5 MOVES AWAY. THE GAME ENDS WHEN HE CATCHES YOU.IF YOU ESCAPE A NEW MAZE IS GENERATED AND YOUR PREVIOUS SCORE CARRIED FORWARD. THE MISTS OF TIME WILL PASS OVER YOU FOR ABOUT 30 SECONDS WHILE TRANSPORTING YOU TO THE LAIR OF TYRANNOSAURUS REX. BEST OF LUCK..... 95 RAND 97 GOTO 1015 100 LET A=USR 17441 110 LET T=0 120 LET X=INT (RND*4) 130 IF PEEK 16514<16 AND RND<.9 THEN LET X=2 140 POKE 16517,X 150 LET X=INT (RND*6) 160 LET T=T+X 170 POKE 16516,X 180 LET A=USR 17461 190 IF T<800 THEN GOTO 120 200 POKE 16514,INT (RND*113) 210 LET A=USR 17617 220 IF PEEK 16514<>255 THEN GOTO 200 230 LET A=USR 17683 235 CLS 240 SLOW 250 PRINT AT 9,27;"SCORE" 260 POKE 16514,255 270 POKE 16515,70 280 POKE 16519,0 290 POKE 16523,8 300 POKE 16516,1 310 LET A=USR 18288 320 IF INKEY$ ="" THEN GOTO 320 330 POKE 17901,INT (RND*128) 335 IF PEEK 21623<>178 THEN POKE ((PEEK 16396+256*PEEK 16397)+66),0 340 POKE 16522,CODE INKEY$ 350 LET A=USR 18224 360 IF PEEK 16519>=128 THEN GOTO 5000 370 FOR N=0 TO 5 380 NEXT N 390 IF PEEK (PEEK 16514+17920)<>45 THEN GOTO 330 400 FOR N=0 TO 30 405 POKE 17901,INT (128*RND) 410 LET A=USR 18224 420 FOR M=0 TO 3 425 NEXT M 430 NEXT N 440 CLS 450 GOTO 2520 1000 CLEAR 1005 CLS 1010 SAVE "3D MONSTER MAZ[E]" 1015 LET N=0 1020 PRINT AT 10,9;"ANYONE THERE?" 1025 LET N=N+1 1027 IF N=100 THEN PRINT AT 12,3;"WELL PRESS SOMETHING THEN." 1030 IF INKEY$ ="" THEN GOTO 1025 1040 CLS 1050 POKE 16514,0 1060 POKE 16515,162 1065 IF PEEK 21592<>183 THEN GOTO USR (PEEK 16510) 1070 POKE 16516,85 1080 LET A=USR 21809 1090 LET A=USR 21836 1100 GOSUB 3000 1110 IF PEEK 16514<58 THEN GOTO 1090 1120 LET A=USR 21829 1125 LET S=7 1130 GOSUB 4000 1140 IF INKEY$ ="K" THEN GOTO 2000 1150 IF INKEY$ ="A" THEN NEW 1160 IF INKEY$ ="C" THEN GOTO 2400 1170 GOTO 1140 2000 POKE 16514,0 2010 LET A=USR 21809 2020 LET A=USR 21836 2030 GOSUB 3000 2040 IF PEEK 16514<64 THEN GOTO 2020 2400 GOSUB 6000 2500 LET A=USR 21829 2505 LET S=8 2510 GOSUB 4000 2520 LET A=USR 21809 2530 POKE 16514,0 2540 POKE 16515,224 2550 POKE 16516,90 2560 LET A=USR 21836 2570 GOSUB 3000 2580 IF PEEK 16514<14 THEN GOTO 2560 2585 LET S=3 2590 GOSUB 4000 2595 LET A=USR 21829 2600 FOR M=0 TO 10 2610 GOSUB 3000 2620 NEXT M 2630 FAST 2636 RAND 2640 GOTO 100 3000 FOR N=0 TO 10 3010 NEXT N 3020 IF PEEK 21627<>170 THEN POKE 16389,68 3030 RETURN 4000 FOR M=0 TO S 4010 POKE 16514,1 4020 LET A=USR 21836 4030 GOSUB 3000 4040 NEXT M 4050 RETURN 5000 LET A=PEEK 16520 5010 IF A>176 AND (A-16*INT (A/16))>9 THEN LET A=USR 17683 5020 IF INKEY$ ="A" THEN GOTO 5050 5030 IF INKEY$ ="C" THEN GOTO 5150 5040 GOTO 5020 5050 CLS 5060 PRINT AT 10,10;"APPEAL" 5070 IF RND>.5 THEN GOTO 5120 5080 PRINT AT 12,10;"ACCEPTED" 5090 FOR N=0 TO 40 5100 NEXT N 5110 NEW 5120 PRINT AT 12,10;"REJECTED" 5130 FOR N=0 TO 30 5140 NEXT N 5150 GOSUB 6000 5160 GOTO 235 6000 POKE 17718,28 6010 POKE 17719,28 6020 POKE 17720,28 6030 POKE 17721,28 6040 RETURN ```