Next: References
Up: Sather 1.0 Tutorial
Previous: Type $PIECEand Related
- Extend Sather Tutorial Chess to print out all moves of the game
in standard chess notation after the game is over.
- If the user decides to have a computer player, the random
number generator always is initialized with the same seed. Extend
Sather Tutorial Chess to ask the user for his name. Then from this
name compute a seed to initialize the random number generator.
- Introduce a new subtype of $PLAYER that inherits the
implementation of MINMAX. Call this class ALPHABETA and
implement an Alpha-Beta-Search to improve the expertise of the
automatic player. You might want to change the routine setup of
MAIN to create an ALPHABETA player instead of a MINMAX player.
- Change POS to be a value class. Instead of having
the internal addressing scheme that numbers the positions of the board
from 0 to 63 in variable absolute, the positions should be
represented with two integers, one for the row number and the other
for the number of the column. Obviously, nearly all routines in POS have to be changed to reflect that choice. Other than that the
code is relatively independent of the implementation of POS. There might be some problems when POS objects are tested
to be void. Furthermore, the routine is the only place outside
of board.str that knows about the internal addressing used in
POS. Note, that the new internal addressing eases the complexity
of the computation of neighboring elements slightly. Instead of
divisions and modulo operations, a routine is_off_board could be
used to deal with all the necessary plausibility testing.
- See section 1.4 for further suggestions.