A downloadable game

ZOMBIE MATH

A 10 liner program for ZX81 / TS1000

by

Alex Boutin

March 8th, 2026

ZOMBIE MATH was devolopped on a Timex Sinclair 1000 (a clone of the ZX81, with 2K of RAM ), then for the Basic 10 Liner Contest, it was entered on EightyOne emulator set as 2K TS1000 [File names are ZM.p and ZM.wav]. 

The goal is to get the right answer to simple math problems before the zombie consumes you. For example, the game starts with the famous 2 + 2 = 5. To correct it, you need to press (or hold) the key 6 for decreasing the value, and 7 for increasing it until you reach the right answer. Keys 6 and 7 were chosen simply because the down and up arrows are located on these keys on the ZX81 and Timex Sinclair 1000, and can be easily pressed with the thumbs (which isn't the case for the recommended “E” and “D”, at least not on the real machine). The values of the decrement and increment are changing at each new equation to solve, so you need to find a new strategy for each new problem. If you success, a new problem will appear and your score will increase. The game is finishing when you reach the score 100/100 [a last problem will appear, but as far as I know, there is no way to avoid the zombie for that one].


Listing:

   1 LET A=5
   2 LET C=7-A
   3 PRINT AT 5,7;"ZOMBIE MATH";AT 10,2;C;" + ";C;" =";AT 9,19;".       ";AT 10,19;"Y       ";AT 18,5;"6(DOWN) / 7(UP)"
   4 FOR B=1 TO 11 STEP 1
   5 PRINT AT 10,11;A;"   ";AT 9,31-B;",";AT 10,31-B;"Z";AT 9,19;".";AT 10,19;"X";AT 9,30-B;". ";AT 10,30-B;"7 "
   6 IF A=C+C THEN GOTO 2
   7 PRINT AT 15,6;"SCORE:";INT (50*((ABS (10*C)+ABS (30/C)-C)-23-15*SGN (C))/43)+6;"/100"
   8 IF INKEY$="7" THEN LET A=A+5*ABS (C)+SGN (C)
   9 IF INKEY$="6" THEN LET A=A-5*ABS (C)+SGN (C)
  10 NEXT B
Character count: 

Line 1 12

Line 2 14

Line 3 119

Line 4 25

Line 5 112

Line 6 25

Line 7 90

Line 8 49

Line 9 49

Line 10 11

Total : 506

The longest logical line is Line 3 [119 characters].

Line by line description:

Line 1 LET the first wrong answer, 5, be assigned to the variable A (i.e. A = 5)

Line 2 LET both numbers of the equations to solve be 7 – A, and be assigned to the variable C

(i.e. C = 7 – A ). For example, for the first equation to solve, with A = 5 (see Line 1), the value of C will be 2.

Line 3 PRINT AT top of the screen, the game title “ZOMBIE MATH” ; in middle of the screen, C + C = (where C is the variable from Line 2), your (happy) character (a “.” over a “Y”) followed by few spaces “ “ (to overwrite the nearby zombie from the previous level [of course, there is nothing to erase at the first level]) ; at bottom of the screen, the game instructions (6 for down, and 7 for up). 

Line 4 The beginning of a FOR NEXT loop with 11 iterations using B as a variable. The initial value of B is 1, then this value will increase by a STEP of 1 after each iteration of the loop (i.e. at each time the NEXT B is reached... see Line 10)

Line 5 PRINT in middle of the screen, AT their respective positions (i.e. the answer, your character and the moving zombie), the variable A (right after the C + C =) followed by few spaces “ “ (to make sure to properly overwrite previous value of A... because if previous A was longer than the actual one, some digits might remain on the screen), then the walking zombie (a “,” over a “Z”), then your character in fighting position (a “.” over a “X”), then the paused zombie (a “. ” over a “7 ”... the added “ “ is for erasing the walking zombie printed earlier). The walking zombie only appears during a very short time, but not too short (your character in fighting position was placed in this PRINT between the walking zombie and the paused zombie with the goal to increase the display time of the walking zombie). And for the paused zombie, it's display time is much more long, and depend mostly of the loop time (Line 7 is a good source of delay). 

Line 6 Verify IF the value of A is really equal to C + C, THEN GOTO 2 [i.e. to break the loop and go to Line 2] if true. Otherwise, the program continues to Line 7.

Line 7 PRINT the score on the screen between the problem and the instructions. The score formula is designed to get an increasing value (from 0/100 to 100/100) with the accomplished levels by using one of the available variables. C was used because it's the only variable that is really dependant of the reached level. This line is also a source of delay for the animated zombie, and also for a better control of the up and down.

Line 8 Verify IF key “7” is pressed/held THEN LET the new value of A be incremented using the formula A=A+5*ABS (C)+SGN (C). For example, at the first level, with C equal to 2, we obtain A = A + 5 * ABS (2) + SGN (2) = A + 5 * (2) + (1) = A + 10 + 1 = A + 11.

Line 9 Verify IF key “6” is pressed/held THEN LET the new value of A be decremented using the formula A=A-5*ABS (C)+SGN (C). For example, at the first level, with C equal to 2, we obtain A = A – 5 * ABS (2) + SGN (2) = A – 5 * (2) + (1) = A – 10 + 1 = A - 9.

Line 10 The NEXT of a FOR NEXT loop (see Line 4). So, to return at Line 4 and continue with the NEXT value of B until B is equal to 11.

Download

Download
ZOMBIE MATH (2026).doc 101 kB
Download
ZOMBIE MATH (2026).pdf 74 kB
Download
ZOMBIE MATH (2026).txt 6.7 kB
Download
ZM.p 797 bytes
Download
ZM.wav 1 MB
Download
ZM.b81 526 bytes
Download
ZM-listing.JPG 15 kB
Download
ZM-listing-txt.txt 526 bytes

Install instructions

Loading the game on EigtyOne emulator:

About using EigtyOne emulator, the default settings (on version 1.41) are 16K ZX81 and the game is working nicely with these settings : therefore, I recommend to use the default settings, and, in case of doubt, to force to default settings by clicking Option / Configuration / Reset to Default Settings.

The game is designed for the slow mode, and because the slow mode is the default mode on EightyOne emulator (and also on the real machine), you don't need to do anything special for it (except if you ran a program in fast mode just before, you might need to force back the slow mode by pressing Shift+D, then enter, or, alternatively, you can perform the Reset to Default Settings, then reload the game). 

Now, you're ready to load the program. 2 files are included : ZM.wav for enjoying a slow loading and ZM.p than can be loaded more easily and almost instantly. The next step is to click File, then Open Tape, and and then choose ZM.wav or ZM.p depending of your preferences. Normally, if you have chosen ZM.p , it should automatically load (after few seconds, LOAD "" should appear on the screen... if not, you can press J, then Shift+P twice, then enter). And if you have chosen ZM.wav, you have to enter it manually (J Shift+P Shift+P ENTER). To list it, press K, then enter. And to run it, press R, then enter. 

So, to summarize, the easiest way to load/run this game on EigtyOne emulator is first to Reset to Default Settings, then to Open Tape ZM.p, then wait until 0/0 appears, then press R, then press enter, and then you are playing. 

Comments

Log in with itch.io to leave a comment.

Great to see 10 liners on the ZX81, good work!

Thanks, 

And the same for your game on the Amstrad CPC, good work!

Ah thank you, all great machines aren't they

Of course ^^