This module defines a type class for nodes in a tree of game states (two-player zero-sum games) and provides algorithms to search the game trees for optimal strategies.
The (heuristic) value of a node in the game tree.
be thought of as -infinity and +infinity.
Score is analogous to the extended real number line,
which is a totally ordered set (see
Score is not a
Semiring, but supports negation (
class Node a where
A node in a game tree, typically representing a given game state.
true if the node refers to a game state that is
either a win, a lose, or a draw. The
score of a node is the (heuristic)
value of the given node and is always defined from the viewpoint of
the 'first' player (the one that calls the search algorithm). Finally,
children returns a list of game states that can be reached through valid
isTerminal n == null (children n)