name:   Othello
author: Christopher Fox (cmfox@argonet.co.uk)
size:   1024 bytes
needs:  ARM2 or later, Mode 27, Squash module (included in RISC OS 3)
descr.: Othello game


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

30/6/99: This is an othello game which uses recursive strategy.  I had to cut out some of the features (such as displaying a number to show whose turn it was) so that I could fit it into 1K.

This version has been assembled so that Player 1 (red) is human and Player 2 (green) is controlled by the computer.  It's possible to change this by modifying bits 2 and 3 of R12 near the beginning of the source code, but I didn't have room to allow it to be changed at run-time.  The computer player will look ahead 5 moves (this is determined by the value of R11 in he "compmove" subroutine).  This only takes a fraction of a second using a StrongARM, but I suspect it may take a lot longer on machines with older processors, although I haven't had a chance to test it on one.

If either player is unable to move, the program will pass automatically, and if both players pass consecutively, it will exit.

The algorithm used for the computer's moves works out a score for each possible move based on values assigned to each square on the board, and then uses recursion to find the other player's best move, and subtracts this from the computer's score.

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

1/7/99: Added compression using the Squash module, which gave me enough space to make it count each player's pieces at the end, and to make the square where the computer is about to move flash.  I also had room to put the number of the player whose turn it is back in the corner of the screen.

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

2/7/99: Corrected a bug in the decompression code which meant that it would only work if "Next" is set to at least 632k.

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

6/7/99: Added code to the start of the program to extend the slot size to 68k (this is probably more than I really need, but I set aside 64k workspace for Squash just to be on the safe side).

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

7/7/99: Wrote FNalign, which is used in place of the ALIGN command and fills the space with zeros, so that the file now always compresses to 1024 bytes.
