AREA CALCULATOR (1K ZX80)
BATTLESHIPS
CATCH
DRAUGHTS
MUSIC (1K ZX80)
ONE-ARMED BANDIT
SHIFT
TOURIST TRAP (16K ZX80)
ZX80 RE-NUMBER (ZX-80)



AREA CALCULATOR (1K ZX80)
from ZX Computing 1 (Summer 1982), page 65

The following program, produced for the ZX80 and using only the 1K of RAM, will
calculate the area within a polygon. The computer plots the points whose
co-ordinates have been entered, using a 36 symbol code, and the area is printed
underneath. The sign of the area will be positive if traced anti-clockwise and
negative if all, or any, of the figure is plotted clockwise. On the display the
plotted points are displayed in the same code as the axes and are numbered
according to the order of entry.

In the entry stage of line 80 and 90, inputs of greater value than 32 and 21
respectively will not be displayed although the area is still calculated. All
the input co-ordinates are repeated after entry for checking, NEWLINE will
cause the program to continue if they are correct.

[An error exists in the magazine listing - the PRINT statement in line 160
should end with a semicolon.]


**********************************************************************
BATTLESHIPS
-----------
A boom, boom here, and a bang, flash there, and devastation covers the seas,
in J Calderwood's version Of the old pencil and paper game.

Here's your chance to play battleships against the ZX80. The programs asks
you to enter a number up to 10, and a letter to J. These are to be entered
one at a time. The clever computer will then show where your bomb landed.
If you hit a ship, it will be shown in inverse, otherwise it shows as an
asterisk. You have to try and land three bombs on each ship.


**********************************************************************
CATCH
Avoid being trapped by your sneaky, little ZX80.

The object of this game by I Soutar is to avoid getting nabbed by the
computer. You move by entering "5" to move left, "6" to move down, "7" to
move up or "8" to move right. When you've moved, the ZX80 will place a black
square on one of the four sides of your position.

If you move onto the black square, all hell will break loose. Well, actually
it won't, but the game will end, and the ZX80 will tell you how many moves
you survived. Anything over 95 is very good, and you'll be awarded a gold star.


**********************************************************************


DRAUGHTS
--------
This is a full game of draughts for the 4K ZX80. A complete board is shown.
You are at the bottom of the screen playing up, and the ZX80 is playing down.
You enter each move as a LETTER NUMBER, then NEWLINE, of the square you're
moving from, then LETTER NUMBER, then NEW LINE, of the square you're moving
to. You'll understand this easily once you see the display. You'll find the
ZX80 plays like a reasonable beginner. Once you've played with it for a
while, you might enjoy trying to improve its standard of play.

Although the computer has no strategy as such (other than look for a capture,
and if it can't make one, look for a legal move) you'll find it plays as
though it had a real method of looking ahead at the game and where it is
developing. Kings are made automatically.


**********************************************************************
MUSIC (1K ZX80)
by Kev Molloy
from ZX Computing 1, Summer 1982, page 101

Kev Molloy decides the days of silent movies are over, and produces a
routine to turn your ZX80 into a music machine.

Kev's program plays a passable version of Greensleeves in this program, which
is stored as a string. The length of each note is stored in another string. The
higher the number (from one to eight) the longer the length of the note. The
key for notes is as follows:
D - V; D sharp - R; E - P; F - N; F sharp  L; G  J; G sharp - M; A - G; B
flat - E; B - C; C  A; C sharp  8;
D  sharp; D sharp - 6; E - 5; F - 4; F sharp - 3; G  1; G sharp - 0.

Although this is only a rough guide, it works on most occasions and whenever it
sounds a bit off, all you need to do is add or subtract one or two.


**********************************************************************
ONE-ARMED BANDIT
----------------
This is a ZX8O version of the pub game. Three barrels are rolled on
which are marked six symbols. According to the symbols displayed,
different payments are awarded.

Winning Positions
COIN      COIN      COIN      66
BELL      BELL      BELL      55
CASTLE    CASTLE    CASTLE    44
LEMON     LEMON     LEMON     33
CHERRY    CHERRY    CHERRY    22
ORANGE    ORANGE    ORANGE    11
COIN      COIN      -         18
-         COIN      COIN      18
BELL      BELL      -         15
-         BELL      BELL      15
CASTLE    CASTLE    -         12
-         CASTLE    CASTLE    12
LEMON     LEMON     -          9
-         LEMON     LEMON      9
CHERRY    CHERRY    -          6
-         CHERRY    CHERRY     6
ORANGE    ORANGE    -          3
-         ORANGE    ORANGE     3
CHERRY    -         -          5

At random intervals, "HOLD" will appear. The player may then choose to hold
any of the barrels.
To hold barrel 1 press "Y" (else "N").
To hold barrel 2 press "Y" (else "N").
To hold barrel 3 press "Y" (else "N").
ie. To hold barrel 1 and barrel 3 press "YNY" ENTER.

List of Variables
A(0) . . . . . . .  Result for barrel one.
A(1) . . . . . . .  Result for barrel two.
A(2) . . . . . . .  Result for barrel three.
C    . . . . . . .  Total prize money awarded.
W$   . . . . . . .  String used for display.
V$   . . . . . . .  String used for display.
H$   . . . . . . .  String used for containing what is to be held "held".
G$   . . . . . . .  String used to check H$ is legal.
Q$   . . . . . . .  String used to stop programme.
I    . . . . . . .  Dummy variable.
J    . . . . . . .  Dummy variable.


**********************************************************************
SHIFT
-----
Winging across the seas from New Brunswick, Canada is Joseph Ho's
ZX80 game based on the slide games in which tiles with the numbers
one to 15 have to be arranged in order.

When you press RUN, you'll see a 4x4 grid. On it are the numbers one to 15,
and an inverse space. The numbers are scrambled, and you have to try and
put them in order with the black square in the lower right-hand corner. The
black square represents an empty space.

The numbers can be moved around by entering a number that is directly above,
below, directly to the left or to the right of the space. A rather quaint
error message  DO OVER  appears if you try to cheat. The number you've
entered, if you haven't cheated, and all the numbers between it and the space
will shift one place towards the space and the space will appear in the place
of the number entered. Once you've solved the problem, the ZX80 will tell you
how long it took you to do it. You'll find it fairly easy to convert this
program to run on a ZX81, although it will not fit within 1K as does the
ZX80 version.

--

Ive noticed TTFn has a few ZX80/81 programs that arent in the standard .O
and .P formats, so I thought I would convert them as appropriate so that
they can be used with the widest range of emulators. Ive attached new
versions of each program, although for some it was only necessary to rename
the file extension. [ PF ]

.P80
The following can simply have their extensions renamed to .O:
- ZX820607_001103Shift(fix).P80
- ZX820607_001103Shift.P80

The .P80 extension was one I created at the same time as creating .P81
format. The .P81 format differs to .P in that it includes the original ZX81
file name at the start of the file. I created .P80 simply so that the
naming matched the ZX81 naming. But since the ZX80 does not include a
file name in its files, there is absolutely no difference to .O format.
Only some of my very old utilities support a .P80 extension; for all newer
utilities I dropped support several years ago. And no emulators support it.
So I strongly advise renaming these two files to avoid confusion for people.
[ PF ]


**********************************************************************
TOURIST TRAP (16K ZX80)
from ZX Computing 1 (Summer 1982), pages 38-42

Tourist Trap is a 4K ZX80 "adventure" type program which can be easily
converted (essentially by changing the way the random numbers are generated)
for the ZX81. It is very, very light-hearted but is fun to play, and gives you
a framework upon which to construct your own ADVENTURE. You might like to try
changing this program slightly so that it asks for, and uses, your name from
time to time.


**********************************************************************
ZX80 RE-NUMBER (ZX-80)
by A Beasley
from ZX Computing 1 (Summer 1982), page 27

After using the ZX80 for a few months I found that there was a need for a
simple renumbering program. In the attempt to solve the problem a BASIC program
was written out but this took far too much memory space. While machine code was
the obvious solution it did raise yet another problem. How could the program be
stored so that it could be used without any trouble. After attempting to store
it in a REM line it was found that some of the codes made the system crash when
the program was listed.


Solutions

To get over the problem the following method was developed. First all the
variables are CLEARed. A string variable is now set up to contain the required
number of bytes and the machine code is POKEd into it. As this string variable
is the first in the list its location can be found from the two bytes called
VARS, see page 122 in the manual. By adding one to the value obtained you have
the location of the first character in the string. To call the program you
simply find the value of VARS, add one and use this number as a USR call.


More Problems

This method generates its own set of problems, however. If you are using it for
program operation you cannot use the following commands, RUN, CLEAR or NEW. By
using GOTO you can get over the RUN problem and the others are not really
drastic.

The main advantage of this method is that when you save the program you still
preserve the string for the next time. It should be noted that the GOTO and
GOSUB statements are not altered but you do get everything into 35 bytes.


Operation

Run the program then remove it by typing just the line numbers and then
'Newline'. The program you wish to renumber can be keyed in but remember not to
use the RUN or CLEAR keys and make sure that the program does not contain Z$.

To activate the renumber type

   PRINT USR (1+PEEK(16392)+PEEK(16393)*256)


[An error exists in the magazine listing on line 4 which should be as follows:

   4 LET A=1+PEEK(16392)+PEEK(16393)*256

The routine renumbers a BASIC program so that it starts at line 10 and
increments in steps of 10.]


--
Another Fine Product transcribed by:
Jim Grimwood, Weardale, England
http://www.users.globalnet.co.uk/~jg27paw4/
--