REVERSI
R.M. Francis, Brentwood, Essex.
from Your Computer, June 1983

WRITTEN FOR A 16K machine to provide a game which is very fast when the
computer is choosing its move, this is also proof against an incorrect entry
by the person playing. The speed has been achieved by a machine-code routine
and the error prevention by a considerable degree of checking by the BASIC
program.

In addition there are two levels of play available; at the lower level the
computer merely maximises the number of its opponent's positions which it
captures; at the higher level it also considers the relative merits of the
position which it will occupy with its own move.

The structure of the BASIC program is as follows:
  20     subroutine to convert the current board positions to an address
         table for use by the machine-code routine
  30-120 subroutine to update current positions when a move has been selected
 130-320 subroutine to print board with current positions
 330-370 subroutine to initialise start positions
 380-520 introduction and initialisation
 530-630 computer's move including call for machine-code program
 640-800 player's move including checks on legality
 810-910 print result of game and restart if required
This should be entered first and saved on tape using the self-start facility,
the command should be:
	SAVE "Reversi" LINE 10
When this has been Verified the computer should be Newed and the command:
	CLEAR 31999
entered. The 465 bytes of machine code should be entered using the following
program:
  10 LET s=0
  20 FOR n=32111 T0 32575
  30 INPUT b
  40 POKE n,b
  50 LET s=s+b
  60 PRINT n; TAB l0;b; TAB 20;s
  70 NEXT n
The purpose of lines 10 and 50 is to provide a sum-check of the machine-code
entry; when all the machine code has been entered the sumcheck total should
be 56695. To ensure that you are on the right track the intermediate checks
are as follows:

After the byte for address 32200 has been entered the total should be 11300
and after 32300 has been entered the total should be 25851. After 32400, the
total should be 35956, and after 32500, the total should be 47032.

When this has been entered, and the sum-check found to be correct then SAVE
it after the BASIC program with the command:
	SAVE "mcode" CODE 32111,465
Once this has been Verified the whole program can be loaded from the
beginning. The self-starting BASIC program will automatically load the
machine code. From then on everything should be self-explanatory.
