Plays a game of noughts and crosses (R.W. Payne).
||Which symbol to play (
||Level of difficulty, either 0, 1, 2 or 3; default
||Seed for the random numbers used by Genstat to select its choice of squares; default 0|
Nought and crosses (or tic-tac-toe) is a game where two players enter symbols alternately onto a three-by-three grid of squares. The first player enters crosses, and the second player enters noughts. The aim is to fill a row with your own symbol, either vertically, horizontally or diagonally.
The procedure first asks you whether you want to play with noughts or crosses. You can then select a level of difficulty, ranging from zero (where Genstat selects its squares at random) to three (where it aims to take an optimum strategy). The squares are displayed by the Genstat graphics viewer, and your choices are selected from a dialog displayed by the
QDIALOG directive. (So you should ensure that these are both viewable during the game.) You can avoid these questions by setting the
SEED option specifies a seed for the random numbers that are used by Genstat to choose its squares. The default value of zero continues an existing sequence of random numbers if any have already been used in the current Genstat job, or obtains a random seed using the system clock if none have been used already.
CAPTION 'NOUGHTSANDCROSSES example',\ '(To be played while running Genstat interactively.)'; \ STYLE=meta,plain NOUGHTSANDCROSSES