Games are instances of the class GameState
. The minimal complete definition for this class must implement the following function:
player
- the player whose current turn it is (eitherMaximizer
orMinimizer
).terminal
- this must be set toNothing
for all terminal nodes, and toJust val
whereval
is the outcome of the game.actions
- these is a list of pairs(name, result)
wherename
is the move's name, andbranch
is the is sub branch of the game that is reached with the move.
All instances of GameState
are also Show
, and their show
value is a presentation of the game's state to the user.
Better documentation will perhaps happen some day in the future.