BATTLESHIPS (16K ZX-81)
by P J Lording
from Popular Computing Weekly Vol. 1 No. 18 (19 August 1982), page 19

The computer is set into fast mode in line 30 and generates the position of 30
ships, 10 cruisers, 10 frigates and 10 aircraft carriers. These are represented
by inverse video symbols of C-F-A and displayed for two seconds to simulate a
sonar trace.

Line 330 clears the screen and subroutine 1000 draws a grid. The position sof
the ships are held in the array DIM A(17,29) and the type of craft is known by
the value of the subscript - 0 for an empty position, 1 for a cruiser, 2 for a
frigate and 3 for a carrier.

B$ holds the co-ordinates for firing the torpedoes and subroutine 3000 compares
the co-ordinates with the value of the corresponding subscripts of the array
and scores according to the craft hit, if any.

The score is displayed constantly and also the number of torpedoes left.


TRACKER
(aka. Hunter-Killer)
by David Lawrence
from Popular Computing Weekly 5th August 1982


As the moon slipped behind a cloud, a lone figure fell silently from
the plane. Suddenly a parachute blossomed and the plane banked away
sharply.

The soft velvety landscape of dense Amazon jungle drew nearer with
upper branches and creepers apparent more than 80 feet above the
ground. This lush cushion rushed up as the intruder crashed into the
trees. Painfully suspended on the lines from the 'chute, the
suffocating heat engulfed him as branches closed overhead.

A quarter of a mile away, the small supplies package broke through the
green surface and fell to the ground. Immediately it began sending its
radio signal so that the killer could be reunited with his weapons. In
Catrillia, the arrival had not gone unnoticed.

Zironas turned to Epa "He is with us" he said. "We have no choice now.
You must go, and go quickly." Epa nodded, stern faced, and Zironas
continued: "He comes with evil intent. Though it offends our code to
send you, we can do nothing else. If he comes to kill, he will be
killed. In these times any measures become acceptable. One orders
actions, without second thought, that before would have seemed too
appalling to contemplate. But it must be. Our country has lived in
peace for 40 years now - and we will kill to keep it so."

Zironas turned away, gesturing that Epa should make ready to leave.
Epa knew her mission would not be easy. The conditions in the jungle
rendered most of her training useless. The assassin would be
impossible to track down and unpredictable in his movements. Epa knew
her adversary would be as well versed in jungle survival as herself.
She returned grimly to her quarters and began to make her final
preparations. The search was on.

Full instructions for playing Hunter-Killer are given in the program.


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


Case Swap / Mem Used
by Roger Valentine
from Popular Computing Weekly 19th August 1982

The case for a capital transfer code

Roger Valentine explains how to swap from upper to lower
case and back again.


This machine code utility routine provides three extra toolkit
functions for the ZX Spectrum: USR 65270 reads through a BASIC
program, converting all lower case letters to upper case; USR 65290
converts upper case to lower case; USR 65200 gives the number of bytes
used by the BASIC program.

These addresses assume that the code is loaded at address 65200 on a
48K Spectrum. The minor changes necessary to relocate for 16K are
given at the end of this article.

The program length section is a useful facility in its own right, both
for checking total program length and for testing the relative lengths
of alternative lines.

The routine is written in three separate modules. The program length
module merely subtracts the system variable PROG from the system
variable VARS. The difference, i.e. length of the program, is given in
BC. If that is all you want, you can omit PUSH BC and POP HL, which
puts PROG into HL for use in module two.

The BASIC program doubles as a loader and a demonstration of the case
swap routine. Line 10 reserves ample memory by lowering RAMTOP.

When you RUN the program, the STOP statement in line 90 will be
encountered as soon as the machine code has been loaded. At this
point, enter CONT to list in upper case, CONT again to list in lower
case, and CONT a third time to print the program length.

Line 9000 saves the Loader program, which is definitely to be
recommended before running. Once the routine is working correctly, you
can enter NEW and save the routine without the loader:

	SAVE "CASE SWAP" CODE 65200,104


16K conversion

The routine can be relocated in a 16K Spectrum with the minimum of
difficulty. The only bytes which must be altered are where module
three calls module two and module two calls module one.

These bytes have been underlined in the listing. The routine occupies
104 bytes, so a suitable location in 16K would be 32000 (CLEAR 31999).


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


Smashout
by John Reynolds
from Popular Computing Weekly 26th August 1982


This program runs on a 16k Spectrum. It is a version of the arcade
game Breakout. Every brick destroyed is worth 10 points. An extra ball
is given if you reach 900 points. This is achieved by clearing one
sheet.

The program makes use of the sound and colour of the ZX Spectrum.
Instructions are contained in the program to tell you which keys move
up and down.


Program Notes

Lines
5       Sets up a random border and sets the paper to blue.
60-90   Sets up the playing area.
100     Checks for obstacle in ball's way. If it
        is a brick then 10 is added to the score,
        makes a noise and rebounds ball.
110-130 If ball hits border then rebounds
        ball and makes a noise.
600     If ball hits bat then rebounds ball.
605     If sheet is cleared then plays tone and
        sets up extra ball and resets playing area.
