SINCLAIR USER, December 1984
Starter Pack


SPOTS (16K ZX-81)
by Pascual Nicholson
from Sinclair User, December 1984, pages 202-203

Fred has a personal problem. His face is full of spots. You control the spot
bug which travels across Fred's face devouring the spots. Beware however, as
you must avoid wandering over the sensitive parts of Fred's face. You must
also clear away all the spots before Boris the spider steals your energy jar.

Spots was written on the 16K ZX-81 by Pascual Nicholson from Lowestoft in
Suffolk.


Variables:
A(), B()        Arrays used to hold the positions of the spots on the face
		while they are being generated.
S               The score.
G               Your grade if you win.
PA              Controls the rate at which the spider descends.
SPT             The level.
X, Y            Co-ordinates for the spot bug.
Z               Indicates which key was last pressed.
U               The number of spots you have cleared.
SP              The vertical co-ordinate of the spider.
I               Used for most loops, in particular the main game loop, and
		thus indicates the number of moves.
J               Used for a loop within a I loop.
R, T            Used during the generation of the co-ordinates for the spots
		to store the initial random numbers.


Line 2          Immediately sends the program to the subroutine at line 800
		which prints the instructions for the game.
Line 4-40       Set up initial values for some of the main variables in the
		program.
Line 45         16418 is the address of one of the ZX-81 system variables.
		In this case it is the store which holds the number of lines
		to be reserved at the bottom of the screen for error reports
		and the like. By POKEing zero into the store Pascual gives
		himself more space to draw the picture.
Lines 50-70     Print Fred's face onto the screen.
Line 72         Print information for the player, and the energy jar.
Lines 75-120    There are to be three spots for each level, and the set of
		nested loops decides where they are to be printed. It is
		important to ensure the spots are not printed on one of the
		features of face. Line 115 makes sure of that by limiting the
		area to three specific sets of locations.
Lines 205-235   Animate the spot bug to move from the jar to the face. What
		would happen if you left out the " " at the end of lines 210
		and 235?
Lines 250-315   The game itself  all the rest is presentation and setting
		up. Some of the best commercial games have very simple 'core'
		routines for playing the game and then use 90% of the memory
		for fancy graphics and polish.
Line 255        Sets the print position according to where the bug will next
		move to.
Line 256        Reads the screen to see whether there is a spot there. If
		there is the routine at 400-425 deletes the spot and adds
		to the score.
Line 257        Reads the screen to see whether there is part of the face
		there. If so you have lost and the routine at 700-720 shows
		Fred's eye blinking and a tear rolling down his cheek.
Line 258        Prints the bug in the new position.
Lines 260-275   Reads the keyboard to let you move the spot bug.
Line 277        Deletes the spot bug preparatory to your next move.
Lines 295       Alter the co-ordinates for the new spot bug position. Using
		the variable z instead of directly changing the co-ordinates
		from INKEY$  e.g. IF INKEY$="5" THEN LET Y=Y-1  means that
		if you do not press a key the computer will go on moving the
		bug according to the last key pressed.
Lines 300-315   Deal with the spider. The variable PA is set at 2 to start
		with, and the expression IF I/PA = INT (I/PA) will be true
		once in every two moves, I being the number of the move. If
		it is true then the spider moves down a space. On later levels
		PA will be larger so you will have more time to remove the
		spots. Line 310 checks to see if the spider has reached the
		Energy Jar.
Lines 320-359   Print the spider removing the jar and a description of what
		has happened.
Lines 400-425   The routine for deleting a spot. At line 420, if all the
		spots have been deleted the computer goes to line 500, the
		win routine.
Lines 500-555   You have cleared all the spots. If you are at level 5 the
		program jumps to the routine at 600 for an overall win.
		Otherwise you are given more spots to deal with, and SPT is
		adjusted for the level, and PA to slow the spider down. The
		picture is changed also to make Fred smile.
Lines 600-650   The final screen congratulating you on winning is printed.
Lines 700-735   The losing routine mentioned above.
Lines 800-820   The instructions subroutine.
Line 850        Do not worry about the inverse letter, just type a normal
		letter S. After checking the whole listing, type GOTO 850
		and the program will SAVE itself, in such a state as to
		automatically RUN when LOADed again.


= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =


Solitaire

The classic wooden peg game Solitaire has been converted for any
Spectrum by A.R. Bright of Stratford-upon-Avon in Warwickshire. You
have to remove all the pegs from the board by leaping over them in the
manner of draughts. Leaps can be made over any adjacent peg, but not
diagonally.

The program uses a flashing cursor to locate the pegs. Move it around
the board using the cursor keys and then press 0 to choose the peg you
want to move. Then press the cursor key corresponding to the direction
you want to move in. The program will refuse all illegal moves. When
you SAVE the program, use the instruction SAVE "name" LINE 1 and the
program will automatically run itself.


= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

