MAGIC SQUARE (1K ZX80)
by Kar Wing Wong
from ZX Computing 2, August/September 1982, pages 96-97

When the Magic Square program is first run, you'll see a three by three grid,
partially filled with black blocks. The object of the game is to create a magic
square by putting numbers in the place of the black blocks. The arrangement of
the blocks can be changed by entering a number, from one to nine, with each
number representing a position on the grid as follows:

   1 2 3
   4 5 6
   7 8 9

When a number is entered, certain blocks will be reversed. A magic square is
formed when the whole grid is black, except for the central square.

Here is the code to help you crack the Magic Square:

(1) When a number belonging to the corner (1, 3, 7 or 9) is entered, the colour
of that quarter of the whole grid will be reversed. For example, when one is
entered, the colour of the numbers 1, 2, 4 and 5 will be reversed.

(2) When a number corresponding to the middle of one of the four sides is
entered (ie. 2, 4, 6 or 8), the colour of that whole side would be reversed.
For example, when a four is entered, numbers 1, 4 and 7 would be reversed.

(3) When the centre one is entered (ie. number 5, numbers 2, 3, 4, 5, 6 and 8
would be reversed.

The magic square is made when the colour of numbers 1, 2, 3, 4, 6, 7, 8 and 9
are black, and the colour of number 5 is white. The computer will tell you the
number of moves you made in order to finish the square, and it will only accept
a number in the range from one to nine. However, the program will stop when you
enter a letter, if you feel like giving up.





MARS LANDING (1K ZX-80)
by Fred Whittle
from ZX Computing 2 (August-September 1982), page 65

From Borrowash, Derby, Fred Whittle sends us this program which also fits
within the 1K on a ZX80.

The screen shows the spaceship landing with a magnification effect when you
drop below 600 feet. You should enter units of burn up to six. Inputs of seven
or above are used to abort the landing, if you lose your nerve. An input of 0
will give you one unit of free fall. The units of burn are calculated in terms
of acceleration so an input of, say, four is equivalent to four twos, of 16
ones, hence high in-puts save fuel, but beware of trying to save fuel, and
entering so much you crash.

With experience, the 60 units of fuel (line 46) will prove more than adequate
to both land and take off again. Yes, you do have to take off again.

The program will not allow you to input more burn than you, have time left, use
more fuel than you've got, or free fall while landed. You leave orbit by
reaching a height of 15000. A warning is given when you are running out of
fuel. You can only land once. If you want to be able to land more than once,
delete (AND NOT F equals 2) in line 180, but this will also mean you cannot
enter one to both take off and land again in the same move. Therefore, the only
effect is to reduce fuel.

[There are errors in the magazine listing, which are corrected as follows:

   125 IF D>6 THEN GO TO 220
   135 IF D=0 AND F=2 THEN GO TO 75
]




ZX REVERSE (1K ZX80)
by Kar Wing Wong
from ZX Computing 2, August/September 1982, page 97

When this game runs, you'll see a random sequence of numbers, from one to nine.
The object of the game is to get the numbers back in order again in as few
moves as possible.

Here's how you do it. If the numbers were arranged 286491537, and you entered
5, then the sequence will become 946821537, that is, the first five numbers
would change places. The computer keeps track of the number of moves you've
made and will know when you've got the numbers back in order.





SEEK (1K ZX-80)
by J Calderwood
from ZX Computing 2 (August-September 1982), pages 64-65

J.R. Calderwood challenges two players to this game, which uses a 1K ZX80, The
object of "Seek'' is to occupy the same position on the playing area as your
opponent. The player moving onto his opponent's position is awarded points
depending where on the playing area they are. For example the top of the area
is less valuable than the bottom. The right is slightly more valuable than the
left.

The two playing positions are set up at random in lines 55 to 60. This position
is printed out in lines 260 to 325. The players are shown at this time inside a
10x10 grid and can move around using keys 5,6, 7 and 8. Movement being in the
direction of the arrows printed over these numbers. After each key is pressed
NEWLINE must be pressed. The number of squares a player can move at a time is
limited to a maximum of 10. In fact it will almost always be less than this
because of the effect of line 130. This line reads the value of position 16414
and if greater than 200 moves out of the loop allowing no more input during
that turn. As this register is incremented 50 times a second and works in
modulo 256 it can be seen that during any five seconds there are just four
seconds during which input will be accepted. It is surprisingly difficult to
judge when inputs will again be accepted. An input of 0 will end the turn.

Although the playing area is shown as a 10x10 square it is possible to move
around outside this area. The computer will keep track of your movements but
will not print your position, you will need to remember it for yourself! This
gives you the opportunity to attack your opponent from hiding.
