TIME SWITCH for Sinclair Spectrum
by Colin Carruthers
from Your Computer Aug.1983

Colin Carruthers illustrates the dangers of spatio-temporal vortices
to Spectrum Time Lords.


Your close encounter with a spatio-temporal anomaly has left you
stranded in an alien land, thousands of years out of sync with your
own time segment. Not only that, but you have forgotten where you
parked your time machine. The object of the game is to find your way
back to your own time.

When writing the game the first problem encountered was how to
represent the various locations used in the program. Each location
requires a description, a list of objects to be found at that location
and a list of the surrounding locations and their directions. 

The solution was to give each location a subroutine, where the
description of the surroundings and pointers to the neighbouring
locations are set. We decided that the objects would best be
represented by two arrays, the first string array holding the
description of each object and the second numeric array holding a
pointer to the location of each object. A pointer value of zero
indicates that that particular object is being carried.

The command decoded converts the input string into lower case, and
splits the string into command and parameter. This allows input to
[be] both upper and lower case.

The game is played by typing in direct commands with verbs followed by
nouns, for example:
	GET ROPE
Some of the other commands recognised are N for north, S for south, E
for east, W for west, U for up and D for down. In addition, there are
a number of special commands. These include: SAVE, which saves the
current game; I, which is short for inventory, gives a list of all
objects being carried; and R which is short for recap, clears the
screen and repeats the description for the surroundings. QUIT exits
from the current game and asks if you want another try.

Once you have typed in the program, save it by typing
	GO TO 9990
This will automatically verify the recording. Anyone who is completely
stuck may send for a special map to ease their frustration. These are
available from Colin Carruthers at [address removed]. Please enclose a
stamped addressed envelope and a cheque/postal order for 50p.

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

Table 1. Variables used.

O$	array of object descriptions
L	array of object locations
I	number of objects being carried
SET	pointer to subroutine that deals with the current location
UP, DO, WE, NO, SO, EA
	pointers to surrounding locations
L$	current location description
I$, A$, B$
	input string, command and parameter respectively
INIT	pointer to initialisation routine
N	FOR/NEXT control variable
FED, FOUND, SP, UND, UNC
	various flags

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

Table 2. Program breakdown.

10-15      Initial set-up sequence
20-499     Main loop
500-530    Command decoder
1000-1500  Location subroutines
2000-2030  Get/Take subroutine
2500-2530  Open subroutine
3000-3030  Unlock subroutine
3500-3550  Feed subroutine
4000-4010  Swim subroutine
4500-4530  Drop subroutine
5000-5080  Initialisation
5500-5550  Inventory subroutine
6000-6030  Smash subroutine
6100-6220  Up subroutine
6500-6540  Read subroutine
7000-7010  Game Over
7500-7530  Light subroutine
8000-8500  Titles
9000-9020  Another game?
9990       Save/Verify

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

