Murgatroyds Revenge

Date: 1982
Type: Cassette
Platform(s): TS 1000
Tags: Game

Murgatroyd’s Revenge is a maze-chase game in which the player navigates through a labyrinth displayed using block graphics while being pursued by multiple enemies called Murgatroyds. The player enters movement commands as strings of up to three characters (N, S, E, W) per turn, and can deploy six one-time tactical items: Panic (random teleport), Mine, Glue, Decoy, Blockage, and Detonate. Enemy AI is implemented entirely in BASIC, with each Murgatroyd computing its preferred direction toward the player each turn and attempting wall-following detours when blocked. A machine code routine is invoked via RAND USR 16519 to handle mine explosion effects, with parameters and results passed through a set of POKEd system addresses around 16514–16518. The game tracks a running score, a high score across games, and escalates difficulty by increasing the number of Murgatroyds each round.


Program Analysis

Program Structure

The program is organized into several well-defined phases:

  1. Initialization (lines 10–220): Sets up the player’s name, derives a display character from the first letter, and configures system variables.
  2. Round setup (lines 240–880): Allocates arrays, draws the maze and HUD using block-graphic PRINT AT statements, and places Murgatroyds and collectibles.
  3. Player turn (lines 1800–2400): Reads a 3-character command string, processes movement or special actions, updates position, and checks for bonus/key events.
  4. Enemy AI (lines 3000–4940): Loops over all active Murgatroyds, computes preferred direction, handles wall collisions and detours, and checks for fatal encounters.
  5. Special action handlers (lines 5200–7500): Dispatches to subroutine blocks for each of the six numbered actions.
  6. Win/loss screens (lines 8000–8780): Handles congratulations, score display, high-score persistence, and new-game prompts.
  7. Save line (line 9000): Saves the program and immediately re-runs it via GOTO 10.

Display and Maze Representation

The entire 20×32 character play area is drawn at startup using a long series of PRINT AT statements containing block graphic characters. The maze walls use characters with codes above 128 (inverse video), passable corridors use CHR$ 27 (space in the ZX81 character set), and special objects use specific character codes: CHR$ 139 for Murgatroyds, CHR$ 21 for mines, CHR$ 23 for glue, CHR$ 15 for decoys, and CHR$ 136 for blockages. The HUD occupies rows 19–21 and columns 20–31, showing the action menu and score area.

Rather than maintaining a separate array for the maze, the game reads cell content directly from the display file using PEEK. The base address of the display file is computed at line 10: D9 = PEEK 16396 + 256*PEEK 16397, and individual cells are accessed as PEEK (D9+1+P+(L*33)), where 33 is the bytes-per-row stride (32 character cells plus one attribute/line-length byte).

Machine Code Routine

A machine code routine is invoked at three points in the program using RAND USR 16519. Parameters are passed by POKEing addresses 16514–16518 immediately before the call:

  • 16514/16515: Low/high bytes of a display file address (the mine’s location, offset by −34 to center the explosion).
  • 16516: The character code of the player’s letter (used to detect if the player is in the blast radius).
  • 16517: Set to 6, apparently a radius or effect parameter.
  • 16518: Result code — 0 means safe, 1 means the key/exit was destroyed, 2 means the player was caught in the explosion.

The routine is embedded in the REM statement at line 1, which is a classic ZX81 technique for storing machine code in a location that is never executed as BASIC but is addressable via USR.

Enemy AI

Each Murgatroyd’s position is stored in arrays L(I) (row) and P(I) (column), with D(I) tracking the last direction of movement to help avoid oscillation. On each turn, the outer loop at line 3000 iterates over all enemies, and an inner loop at line 3040 (with J from 1 to 2) allows each enemy up to two movement attempts per player turn, with a random chance (line 4930) of a third attempt.

Direction preference is computed by comparing the signed row and column differences (L9, P9) between the enemy and the player. The dominant axis determines the primary direction. If the preferred cell is blocked (character code ≥129 and ≠139), the code falls through to a set of wall-following alternatives, trying the secondary axis or reversing, with the prior direction stored in D(I) used to prevent immediate reversals. This produces reasonably competent pursuit behavior entirely in BASIC.

When a Murgatroyd lands on a mine (D8=21 or D8=3), it teleports to a random open cell and the machine code explosion routine fires. If it lands on glue (D8=23), it is frozen in place (L(I)=0 skips it in future loops) and the player scores 50 points.

Player Input and Movement

The player inputs a 3-character string Q$. If the first character is a digit 1–6, it routes to a special action. Otherwise, the three characters are treated as consecutive movement directions (N/S/E/W), allowing up to three steps per turn. A “sticky default” fills unused characters: if Q$(2) is a space, it is set to Q$(1), and similarly for Q$(3), so entering a single direction moves three steps in that direction.

The previous position is saved in L2/P2 before each step, allowing the code to restore position on collision. Additionally, L4/P4 save the last successfully vacated cell to handle the edge case where the player cannot move at all.

Special Actions

KeyActionFlag variableOne-time?
1Panic — teleport to random open cellF1Yes
2Lay Mine — place mine at previous cellM1Yes
3Drop Glue — place glue at previous cellG1Yes
4Set Decoy — place decoy in a quadrant near playerC1/C2Yes (resets on decoy hit)
5Blockage — place wall block at previous cellW1Yes
6Detonate — remotely explode laid mineM1 checkRequires mine placed

Each action checks its flag variable and prints “ILLEGAL MOVE” if already used. The decoy (action 4) uses C1 and C2 to bias the random placement toward the opposite quadrant from the player, making it more likely to draw Murgatroyds away.

Scoring and Progression

Score S1 accumulates throughout a game: +10 per move (if not in decoy mode), +200 for reaching the key at position (9,10), +100 and +50 for mine and glue kills respectively, and +300 for winning a round. High score S2 persists across games within a session. Each new round increments M2 (starting at 3 after initialization), increasing the Murgatroyd count. The player’s starting row alternates randomly between row 1 and row 18.

Notable Techniques and Anomalies

  • Line 90 checks for an all-spaces name input (14 spaces matching the DIM T$(14) default) and substitutes “NAMELESS ONE”.
  • Lines 100–140 scan the name string backwards to find the last non-space character and append a period, used as a display suffix.
  • The decoy mechanic temporarily swaps L1/P1 (player position) with L6/P6 (saved position) and sets C1=2, causing all enemy AI to target the decoy’s position instead of the player for one full enemy turn cycle.
  • Line 2990 duplicates LET L1=L6 (also present at line 4965), which is a minor redundancy bug.
  • The mine detonation address stored in D6 at line 5910 is computed as D9+1+P2+(L2*33)-34 (offset by −34, approximately one row up and one column left), centering the explosion effect on the mine cell.
  • The POKE 16517,6 at line 15 and line 4610 sets a system variable (MARGIN or similar) that the machine code routine uses as an explosion radius parameter.
  • Line 4930 uses INT (RND*5)=3 to give each enemy a 20% chance of a third movement step per turn, adding unpredictability.

Content

Appears On

Related Products

The fiendish Murgatroyds are on the warpath again. You must fight off their attack with mines, superglue, decoys, and more....

Related Articles

Related Content

Image Gallery

Source Code

   1 REM K#M▞ )▝ Y▀E▙RND#STR$ ▘▀ # RETURN[$]TAB [G]RND PRINT  FAST5▚RND# RETURN▝ LPRINT ASN [F]RNDY▘M▚RND LET  FAST5▜RND# LPRINT [U]TAB [Z]RND PRINT Y▝M▚RND LET LEN # RETURN▟ IF TAN RND RETURN▗ IF SQR RND FAST5▐RND# LPRINT #$ASN **RND7#[=]RNDSGN +ASN  NEWRNDVAL ▘3 ,,AT #[(]RND1COS VAL ▞#:#$TAB  GOSUB RND▌TAB  FOR RNDAT 5▐RNDQ.#[~~]RND67890
   5 REM MURGATROYDS REVENGE -  ZX81 VERSION - 13K BYTES
   7 REM CGM02 COPYRIGHT COLLINS   COMPUTING 1982 
  10 LET D9=PEEK 16396+256*PEEK 16397
  15 POKE 16517,6
  20 RAND 
  30 DIM T$(14)
  40 LET S2=0
  60 PRINT "WHAT""S YOUR NAME?"
  70 PRINT 
  80 INPUT T$
  90 IF T$="              " THEN LET T$="NAMELESS ONE"
 100 FOR I=13 TO 1 STEP -1
 110 IF T$(I)=" " THEN GOTO 140
 120 LET T$(I+1)="."
 130 LET I=1
 140 NEXT I
 150 LET N$=T$(1)
 160 IF N$<"A" OR N$>"Z" THEN LET N$="X"
 165 POKE 16516,CODE N$
 170 PRINT "RIGHT, A LETTER """;N$;""" WILL MARK" 
 180 PRINT "YOUR POSITION, ";T$
 190 PRINT 
 220 PAUSE 200
 240 CLS
 250 LET M2=2
 260 DIM P(10)
 270 DIM L(10)
 280 DIM D(10)
 290 DIM Q$(3)
 300 LET S1=0
 310 DIM V(4)
 320 DIM W(4)
 340 LET M2=M2+1
 350 LET L1=0
 380 LET F1=0
 390 LET G1=0
 400 LET C1=1
 410 LET W1=0
 420 LET C2=1
 440 LET K1=0
 450 LET M1=0
 480 PRINT AT 10,5;"HERE WE GO - GOOD LUCK"
 500 PRINT AT 0,0;"▗▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄"
 520 PRINT AT 19,0;"▐▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▟[S][C][O][R][E][:]██████"
 540 PRINT AT 1,0;"▐..................▐--ACTIONS--▐"
 560 PRINT AT 18,0;"▐..................▐           ▐"
 580 PRINT AT 2,0;"▐.[▒][▒][▒].[▒][▒][▒].[▒][▒][▒].[▒][▒][▒][▒].▐           ▐"
 600 PRINT AT 17,0;"▐.[▒][▒][▒].[▒][▒][▒].[▒][▒][▒].[▒][▒][▒][▒].▐           ▐"
 620 PRINT AT 3,0;"▐.[▒]..............[▒].▐1.PANIC    ▐"
 640 PRINT AT 16,0;"▐.[▒]..............[▒].▐           ▐"
 660 PRINT AT 4,0;"▐.[▒].[▒][▒][▒].[▒][▒][▒].[▒][▒][▒][▒].[▒].▐2.LAY MINE ▐"
 680 PRINT AT 15,0;"▐.[▒].[▒][▒][▒].[▒][▒][▒].[▒][▒][▒][▒].[▒].▐           ▐"
 700 PRINT AT 5,0;"▐.[▒].[▒]..........[▒]...▐3.DROP GLUE▐"
 720 PRINT AT 14,0;"▐...[▒]..........[▒].[▒].▐           ▐"
 740 PRINT AT 6,0;"▐...[▒].[▒][▒].[▒][▒].[▒][▒].[▒].[▒].▐4.SET DECOY▐"
 760 PRINT AT 13,0;"▐.[▒].[▒].[▒][▒].[▒][▒].[▒][▒].[▒]...▐▀▀▀▀▀▀▀▀▀▀▀▜"
 780 PRINT AT 7,0;"▐.[▒]...[▒]..[▒][▒]..[▒]...[▒].▐5.BLOCKAGE ▐"
 800 PRINT AT 12,0;"▐.[▒]...[▒][▒].[▒][▒].[▒][▒]...[▒].▐           ▐"
 820 PRINT AT 8,0;"▐.[▒].[▒].[▒].[▒][▒][▒][▒].[▒].[▒].[▒].▐6.DETONATE ▐"
 840 PRINT AT 11,0;"▐.[▒].[▒].[▒]..[▒][▒]..[▒].[▒].[▒].▐██[H][I][-][S][C][O][R][E]██"
 860 PRINT AT 9,0;"▐.[▒].[▒].[▒]......[▒].[▒]...▐      MINE ▐"
 870 PAUSE 100
 880 PRINT AT 10,0;"▐...[▒].[▒].[▒][▒][▒][▒].[▒].[▒].[▒].▐           ▐"
 1000 PRINT AT 8,10;CHR$ 141
 1020 IF S2>0 THEN PRINT AT 12,24;S2
 1040 FOR I=1 TO 4
 1060 LET V(I)=INT (RND*16)+2
 1080 LET W(I)=INT (RND*16)+2
 1100 IF PEEK (D9+1+W(I)+(V(I)*33))<>136 THEN GOTO 1060
 1120 PRINT AT V(I),W(I);CHR$ 8
 1140 NEXT I
 1300 FOR I=1 TO M2
 1320 LET L(I)=INT ((RND*17)+2)
 1340 LET P(I)=INT ((RND*18)+1)
 1360 IF PEEK (D9+1+P(I)+(L(I)*33))<>27 THEN GOTO 1320
 1380 PRINT AT L(I),P(I);CHR$ 139
 1400 NEXT I
 1600 IF RND*11>5 THEN LET L1=18
 1620 IF L1<>18 THEN LET L1=1
 1640 LET P1=INT ((RND*17)+1)
 1660 PRINT AT L1,P1;N$
 1680 LET L2=L1
 1700 LET P2=P1+1
 1800 PRINT AT 21,1;"MAKE YOUR MOVE"
 1805 INPUT Q$
 1810 PRINT AT 15,21;" COLLINS "
 1815 PRINT AT 16,21;"COMPUTING"
 1830 PRINT AT 21,1;"WAIT . . . . . "
 1840 IF Q$(1)>"0" AND Q$(1)<"7" THEN GOTO 5200
 1850 IF Q$(2)=" " THEN LET Q$(2)=Q$(1)
 1860 IF Q$(3)=" " THEN LET Q$(3)=Q$(2)
 1870 IF K1=0 THEN LET S1=S1+10
 1875 PRINT AT 19,26;S1
 1880 FOR I=1 TO 3
 1885 LET P2=P1
 1890 LET L2=L1
 1920 IF Q$(I)="N" THEN LET L1=L1-1
 1940 IF Q$(I)="S" THEN LET L1=L1+1
 1960 IF Q$(I)="W" THEN LET P1=P1-1
 1980 IF Q$(I)="E" THEN LET P1=P1+1
 2000 LET D8=PEEK (D9+1+P1+(L1*33))
 2010 IF D8=139 OR D8=21 OR D8=23 THEN GOTO 5000
 2020 IF D8<>27 THEN LET L1=L2
 2030 IF D8<>27 THEN LET P1=P2
 2040 PRINT AT L2,P2;CHR$ 27
 2060 PRINT AT L1,P1;N$
 2070 IF L1=L2 AND P1=P2 THEN LET P2=P4
 2075 IF L1=L2 AND P1=P2 THEN LET L2=L4
 2080 IF L1=L2 AND P1=P2 THEN GOTO 2100
 2085 LET L4=L2
 2090 LET P4=P2
 2100 IF K1<>0 THEN GOTO 2300
 2120 IF L1<>9 THEN GOTO 2300
 2140 IF P1<>10 THEN GOTO 2300
 2160 LET P5=0
 2180 IF INT (RND*2)=1 THEN LET P5=19
 2200 LET L5=INT (RND*8)+6
 2210 PRINT AT L5,P5;CHR$ 27
 2220 PRINT AT 8,10;CHR$ 136
 2230 LET S1=S1+200
 2233 PRINT AT 19,26;S1
 2235 PRINT AT 15,21;"  BONUS  "
 2237 PRINT AT 16,21;"   200   "
 2240 PRINT AT 19,31;CHR$ 141
 2250 PRINT AT 19,26;S1
 2260 LET K1=1
 2300 IF K1<>1 THEN GOTO 2400
 2320 IF L1<>L5 THEN GOTO 2400
 2340 IF P1<>P5 THEN GOTO 2400
 2360 GOTO 8000
 2400 NEXT I
 2900 IF C1<>2 THEN GOTO 3000
 2920 LET L6=L1
 2940 LET P6=P1
 2960 LET L1=L7
 2980 LET P1=P7
 2990 LET C2=C2+1
 3000 FOR I=1 TO M2
 3020 IF L(I)=0 THEN GOTO 4940
 3040 FOR J=1 TO 2
 3080 LET L9=L1-L(I)
 3100 LET P9=P1-P(I)
 3120 LET V$="S"
 3140 IF L9<0 THEN LET V$="N"
 3160 LET H$="E"
 3180 IF P9<0 THEN LET H$="W"
 3200 LET D$=H$
 3220 IF ABS P9<ABS L9 THEN LET D$=V$
 3240 LET D8=D9+1+P(I)+(L(I)*33)
 3280 IF D$="S" THEN GOTO 3600
 3300 IF D$="W" THEN GOTO 3800
 3320 IF D$="E" THEN GOTO 4000
 3400 IF (PEEK (D8-33)<129 OR PEEK (D8-33)=139) AND D(I)<>3 THEN GOTO 4200
 3440 IF H$<>"E" AND (PEEK (D8-1)<129 OR PEEK (D8-1)=139) THEN LET D$="W"
 3460 IF H$<>"W" AND (PEEK (D8+1)<129 OR PEEK (D8+1)=139) THEN LET D$="E"
 3480 IF (PEEK (D8-1)>128 AND PEEK (D8-1)<>139) AND (PEEK (D8+1)>128 AND PEEK (D8+1)<>139) THEN LET D$="S"
 3520 IF D$<>"N" THEN GOTO 4200
 3540 IF (PEEK (D8-1)<129 OR PEEK (D8-1)=139) THEN LET D$="W"
 3560 IF D$="W" THEN GOTO 4200
 3580 IF (PEEK (D8+1)<129 OR PEEK (D8+1)=139) THEN LET D$="E"
 3590 GOTO 4200
 3600 IF (PEEK (D8+33)<129 OR PEEK (D8+33)=139) AND D(I)<>1 THEN GOTO 4200
 3640 IF H$<>"E" AND (PEEK (D8-1)<129 OR PEEK (D8-1)=139) THEN LET D$="W"
 3660 IF H$<>"W" AND (PEEK (D8+1)<129 OR PEEK (D8+1)=139) THEN LET D$="E"
 3680 IF (PEEK (D8-1)>128 AND PEEK (D8-1)<>139) AND (PEEK (D8+1)>128 AND PEEK (D8+1)<>139) THEN LET D$="N"
 3720 IF D$<>"S" THEN GOTO 4200
 3740 IF (PEEK (D8-1)<129 OR PEEK (D8-1)=139) THEN LET D$="W"
 3760 IF D$="W" THEN GOTO 4200
 3780 IF (PEEK (D8+1)<129 OR PEEK (D8+1)=139) THEN LET D$="E"
 3790 GOTO 4200
 3800 IF (PEEK (D8-1)<129 OR PEEK (D8-1)=139) AND D(I)<>2 THEN GOTO 4200
 3840 IF V$<>"N" AND (PEEK (D8+33)<129 OR PEEK (D8+33)=139) THEN LET D$="S"
 3860 IF V$<>"S" AND (PEEK (D8-33)<129 OR PEEK (D8-33)=139) THEN LET D$="N"
 3880 IF (PEEK (D8-33)>128 AND PEEK (D8-33)<>139) AND (PEEK (D8+33)>128 AND PEEK (D8+33)<>139) THEN LET D$="E"
 3920 IF D$<>"W" THEN GOTO 4200
 3940 IF (PEEK (D8-33)<129 OR PEEK (D8-33)=139) THEN LET D$="N"
 3960 IF D$="N" THEN GOTO 4200
 3980 IF (PEEK (D8+33)<129 OR PEEK (D8+33)=139) THEN LET D$="S"
 3990 GOTO 4200
 4000 IF (PEEK (D8+1)<129 OR PEEK (D8+1)=139) AND D(I)<>4 THEN GOTO 4200
 4040 IF V$<>"N" AND (PEEK (D8+33)<129 OR PEEK (D8+33)=139) THEN LET D$="S"
 4060 IF V$<>"S" AND (PEEK (D8-33)<129 OR PEEK (D8-33)=139) THEN LET D$="N"
 4080 IF (PEEK (D8-33)>128 AND PEEK (D8-33)<>139) AND (PEEK (D8+33)>128 AND PEEK (D8+33)<>139) THEN LET D$="W"
 4120 IF D$<>"E" THEN GOTO 4200
 4140 IF (PEEK (D8-33)<129 OR PEEK (D8-33)=139) THEN LET D$="N"
 4160 IF D$="N" THEN GOTO 4200
 4180 IF (PEEK (D8+33)<129 OR PEEK (D8+33)=139) THEN LET D$="S"
 4190 GOTO 4200
 4200 LET L8=L(I)
 4220 LET P8=P(I)
 4300 IF D$="N" THEN LET L(I)=L(I)-1
 4310 IF D$="N" THEN LET D(I)=1
 4320 IF D$="S" THEN LET L(I)=L(I)+1
 4330 IF D$="S" THEN LET D(I)=3
 4340 IF D$="W" THEN LET P(I)=P(I)-1
 4350 IF D$="W" THEN LET D(I)=4
 4360 IF D$="E" THEN LET P(I)=P(I)+1
 4370 IF D$="E" THEN LET D(I)=2
 4380 LET D8=PEEK (D9+1+P(I)+(L(I)*33))
 4400 IF D8<>139 AND D8<>3 THEN GOTO 4560
 4420 LET L(I)=INT (RND*18)+1
 4440 LET P(I)=INT (RND*18)+1
 4460 IF PEEK (D9+1+P(I)+(L(I)*33))<>27 THEN GOTO 4420
 4480 PRINT AT L(I),P(I);CHR$ 139
 4500 PRINT AT L8,P8;CHR$ 27
 4520 LET D(I)=0
 4540 GOTO 4920
 4560 IF D8<>CODE N$ THEN GOTO 4600
 4570 PRINT AT L(I),P(I);CHR$ 139
 4580 PRINT AT L8,P8;"."
 4590 PRINT AT 21,0;"BAD LUCK, A MURGATROYD GOT YOU. "
 4595 GOTO 8500
 4600 IF D8<>21 THEN GOTO 4860
 4602 LET D7=(D9+1+P(I)+(L(I)*33))-34
 4604 POKE 16514,D7-INT (D7/256)*256
 4606 POKE 16515,INT (D7/256)
 4608 POKE 16516,CODE N$
 4610 POKE 16517,6
 4615 POKE 16518,0
 4620 RAND USR 16519
 4630 LET M1=2
 4640 IF PEEK 16518=2 THEN GOTO 7600
 4660 IF PEEK 16518=1 THEN GOTO 7800
 4700 LET S1=S1+100
 4710 PRINT AT 19,26;S1
 4713 PRINT AT 15,21;"  BONUS  "
 4715 PRINT AT 16,21;"   100   "
 4820 LET L(I)=0
 4840 GOTO 4940
 4860 PRINT AT L(I),P(I);CHR$ 139
 4880 PRINT AT L8,P8;CHR$ 27
 4885 IF D8=15 THEN LET C2=3
 4890 IF D8=15 THEN GOTO 4960
 4894 IF D8<>23 THEN GOTO 4920
 4895 PRINT AT L(I),P(I);CHR$ 3
 4900 LET L(I)=0
 4905 LET S1=S1+50
 4907 PRINT AT 19,26;S1
 4910 GOTO 4940
 4920 NEXT J
 4930 IF INT (RND*5)=3 THEN GOTO 3040
 4940 NEXT I
 4950 IF C1<>2 THEN GOTO 1800
 4960 LET L1=L6
 4965 LET L1=L6
 4970 LET P1=P6
 4980 IF C2=3 THEN LET C1=1
 4985 IF C2=3 THEN PRINT AT L7,P7;CHR$ 27
 4990 GOTO 1800
 5000 PRINT AT L1,P1;N$
 5005 PRINT AT L2,P2;"."
 5010 IF D8<>21 THEN GOTO 5100
 5020 LET D7=(D9+1+P1+L1*33)-34
 5030 POKE 16514,D7-INT (D7/256)*256
 5035 POKE 16515,INT (D7/256)
 5040 POKE 16518,0
 5050 RAND USR 16519
 5060 PRINT AT 21,0;"IDIOT, YOU""VE BLOWN YOURSELF UP."
 5070 GOTO 8500
 5100 IF D8<>23 THEN GOTO 5150
 5130 PRINT AT L1,P1;CHR$ ((CODE N$)+128)
 5135 PRINT AT 21,0;"YOU FOOL, YOU""RE STUCK NOW.    "
 5140 GOTO 8500
 5150 PRINT AT L1,P1;CHR$ 139
 5160 PRINT AT 21,0;"RIGHT INTO A MURGATROYD, TWERP. "
 5170 GOTO 8500
 5200 IF Q$(1)="1" THEN GOTO 5400
 5220 IF Q$(1)="2" THEN GOTO 5800
 5240 IF Q$(1)="3" THEN GOTO 6200
 5260 IF Q$(1)="4" THEN GOTO 6600
 5280 IF Q$(1)="5" THEN GOTO 7000
 5300 IF Q$(1)="6" THEN GOTO 7400
 5400 IF F1<>1 THEN GOTO 5410
 5402 PRINT AT 15,22;"ILLEGAL"
 5404 PRINT AT 16,21;"  MOVE.  "
 5406 GOTO 5560
 5410 LET L2=L1
 5420 LET P2=P1
 5430 LET L1=INT (RND*18)+1
 5440 LET P1=INT (RND*18)+1
 5460 LET D8=PEEK (D9+1+P1+(L1*33))
 5480 IF D8<>27 THEN GOTO 5430
 5500 PRINT AT L2,P2;CHR$ 27
 5520 PRINT AT L1,P1;N$
 5540 LET F1=1
 5560 PRINT AT 3,22;"USED "
 5580 GOTO 2900
 5800 IF M1=0 THEN GOTO 5820
 5805 PRINT AT 15,22;"ILLEGAL"
 5810 PRINT AT 16,21;"  MOVE.  "
 5815 GOTO 5920
 5820 LET M1=1
 5830 PRINT AT 4,22;"USED    "
 5840 LET D8=PEEK (D9+1+P2+(L2*33))
 5850 IF D8=139 THEN LET M1=2
 5860 IF D8=139 THEN GOTO 3000
 5880 PRINT AT L2,P2;CHR$ 21
 5910 LET D6=(D9+1+P2+(L2*33))-34
 5920 GOTO 2900
 6200 IF G1<>1 THEN GOTO 6220
 6205 PRINT AT 15,22;"ILLEGAL"
 6210 PRINT AT 16,21;"  MOVE.  "
 6215 GOTO 6320
 6220 LET G1=1
 6240 LET D8=PEEK (D9+1+P2+(L2*33))
 6260 IF D8=139 THEN GOTO 3000
 6280 PRINT AT L2,P2;CHR$ 23
 6300 PRINT AT 5,22;"USED     "
 6320 GOTO 2900
 6600 IF L1<10 THEN LET C1=10
 6620 IF P1<10 THEN LET C2=10
 6640 LET L7=INT (RND*9)+C1
 6660 LET P7=INT (RND*9)+C2
 6680 IF PEEK (D9+1+P7+(L7*33))<>27 THEN GOTO 6640
 6700 PRINT AT L7,P7;CHR$ 15
 6720 PRINT AT 6,22;"USED     "
 6740 LET C2=0
 6760 LET C1=2
 6780 GOTO 2900
 7000 IF W1<>1 THEN GOTO 7020
 7005 PRINT AT 15,22;"ILLEGAL"
 7010 PRINT AT 16,21;"  MOVE.  "
 7015 GOTO 7120
 7020 LET W1=1
 7040 LET D8=PEEK (D9+1+P2+(L2*33))
 7060 IF D8=139 THEN GOTO 2900
 7080 PRINT AT L2,P2;CHR$ 136
 7100 PRINT AT 7,22;"USED     "
 7120 GOTO 2900
 7400 IF M1<>1 THEN PRINT AT 15,22;"ILLEGAL"
 7410 IF M1<>1 THEN PRINT AT 16,21;"  MOVE.  "
 7420 IF M1<>1 THEN GOTO 2900
 7430 LET M1=2
 7440 PRINT AT 8,22;"USED    "
 7445 PRINT AT 9,22;"        "
 7450 POKE 16516,CODE N$
 7460 POKE 16514,D6-INT (D6/256)*256
 7480 POKE 16515,INT (D6/256)
 7490 POKE 16518,0
 7500 RAND USR 16519
 7510 IF PEEK 16518=1 THEN GOTO 7800
 7520 IF PEEK 16518<>2 THEN GOTO 2900
 7600 PRINT AT 21,0;"YOU WERE TOO NEAR THAT EXPLOSION"
 7620 GOTO 8500
 7800 PRINT AT 21,0;"YOU""RE DONE FOR--THE KEY IS GONE"
 7820 GOTO 8500
 8000 REM WIN
 8010 CLS
 8020 PRINT 
 8030 LET S1=S1+300
 8040 PRINT "       CONGRATULATIONS - "
 8050 PRINT 
 8060 PRINT 
 8070 PRINT 
 8080 PRINT "YOU""VE  BEATEN THEM  THIS  TIME."   
 8090 PRINT 
 8100 PRINT 
 8105 PRINT "        AND SCORED ";S1
 8107 PRINT 
 8110 PRINT 
 8115 PRINT 
 8117 PRINT 
 8120 PRINT "READY FOR A NEW  SHEET WITH MORE"
 8130 PRINT 
 8140 PRINT 
 8150 PRINT 
 8160 PRINT "    M U R G A T R O Y D S ?    "
 8180 PAUSE 400
 8200 GOTO 340
 8500 REM LOST - OFFER NEW GAME
 8520 PAUSE 150
 8530 IF S1>S2 THEN LET S2=S1
 8540 CLS
 8560 PRINT "YOUR FINAL SCORE WAS ";S1
 8580 PRINT 
 8600 PRINT "WOULD YOU LIKE ANOTHER GAME?"
 8620 INPUT Q$
 8640 IF Q$(1)="Y" THEN GOTO 250
 8660 IF Q$(1)="N" THEN GOTO 8720
 8670 PRINT 
 8680 PRINT "ANSWER YES OR NO"
 8700 GOTO 8620
 8720 CLS
 8740 PRINT AT 5,8;"COPYRIGHT 1982"
 8750 PRINT 
 8760 PRINT AT 7,7;"COLLINS COMPUTING"
 8780 STOP
 9000 SAVE "M[R]"
 9020 GOTO 10

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

People

No people associated with this content.

Scroll to Top