SEMAPHORE
by Philip Jennings
from ZX Computing Jun/Jul.1984

We put the flags out for this fascinating program
from Philip Jennings of Birmingham.


Did you know that people were transmitting and receiving
long distance messages years before CB was invented! We've
all seen old war films where semaphore signals are sent from
ship to ship to relay vital information. Well, now you can
learn the code and decipher those signals with the aid of
this ZX81 program designed for the expanded machine.

All the relevant signals are assigned to S$ and the diagram
[see SEMAPHOR.GIF] shows what each signal should be and
helps should you make a mistake. On running the program you
are asked to select:

1 Type message    Must be selected to enter the message you want
                  to send.
2 Send semaphore  Sends the message you have just input.
3 Test semaphore  Sends message one piece at a time. Letter must
                  be input before it can proceed and mistakes are
                  marked with an inverse E. The correct message is
                  displayed on completion.

Note that the computer sends the authentic 'call up' before
sending any message and each number is preceded by the
'number follows' signal. This is automatic. Incidentally,
you can enter messages 'in secret' when they are not
displayed on the screen before testing.

Type in Listing 1 first, exactly as printed. Line 1 must
contain at least 152 characters. RUN the program and enter
each of the numbers in Fig 1 one at a time; ie. 4 newline 2
newline etc.

These numbers are not machine code but are the respective
array element positions of each of the flags. It is best to
check your work now, to be wrong would give erroneous
information to the user. So, enter Listing 1a, deleting line
3 (Do not NEW) and RUN. Check the numbers displayed with
those printed to make sure you have entered them correctly.

Now delete lines 2, 4 and 5 and enter the main program,
Listing 2. Once you have RUN the program and checked with
some test messages then SAVE it by typing GOTO 4000. On
subsequent loadings the program will auto run and be
instantly ready for use as it will not have to set up array
S$ again. The last message entered will be saved as well.


= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Fig.1

4 2 4 3 3 1 4 3 2 2 4 3 1 3 4 3
2 4 4 3 4 3 3 5 4 3 4 4 4 2 3 1
4 2 2 2 4 2 4 3 3 1 4 3 2 2 4 3
1 3 4 3 2 4 4 3 4 3 3 5 4 3 4 4
4 2 3 1 4 2 2 2 1 3 3 5 4 2 1 3
4 2 2 4 4 2 3 5 4 2 4 4 3 1 2 2
3 1 1 3 3 1 2 4 3 1 3 5 3 1 4 4
2 2 1 3 2 2 2 4 1 3 4 4 3 5 2 4
2 4 4 4 2 2 3 5 3 5 4 4 4 3 4 3
1 3 2 4 4 4 4 4


--
Another Fine Product transcribed by:
Jim Grimwood (jimg@globalnet.co.uk), Weardale, England
--
