Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type BareGameTree = Tree Game
- type MoveFrequency = MoveFrequency Move
- data GameTree
- countGames :: Depth -> NGames
- countPositions :: Depth -> NPositions
- traceRoute :: GameTree -> [Turn] -> Maybe [Game]
- sortGameTree :: Maybe CaptureMoveSortAlgorithm -> EvaluateRank -> MoveFrequency -> Transformation
- toMoveFrequency :: GameTree -> MoveFrequency
- fromBareGameTree :: BareGameTree -> GameTree
- fromGame :: Game -> GameTree
Types
Type-synonyms
type BareGameTree = Tree Game Source #
Each node defines the state of the game.
type MoveFrequency = MoveFrequency Move Source #
Focus the underlying type.
Data-types
Wrap a BareGameTree
.
Instances
Show GameTree Source # | |
Default GameTree Source # | |
Defined in BishBosh.Model.GameTree | |
Prunable GameTree Source # | |
ShowNotation GameTree Source # | |
Defined in BishBosh.Model.GameTree showsNotation :: MoveNotation -> GameTree -> ShowS Source # |
Functions
countGames :: Depth -> NGames Source #
- Counts the number of game-states in the constant game of chess, at the specified depth, including any which terminated earlier.
- N.B.: some of the game-states may have identical positions, reached by different sequences of moves.
countPositions :: Depth -> NPositions Source #
Counts the number of possible positions in chess, down to the specified depth. N.B.: some of these may be transpositions.
:: GameTree | |
-> [Turn] | The data against which, nodes from the tree should be matched. |
-> Maybe [Game] | Returns |
Trace the route down the tree which matches the specified list of turns.
sortGameTree :: Maybe CaptureMoveSortAlgorithm -> EvaluateRank -> MoveFrequency -> Transformation Source #
- Independently sorts the forest of moves at each node of the tree, without regard to runtime-data.
- Depending on preferences, the list of moves available from each position is sorted by; either those which capture a valuable piece using a cheap piece, or those which win extended battles at a specific location.
- The above sort-algorithms are stable & can therefore be applied independently.
toMoveFrequency :: GameTree -> MoveFrequency Source #
- Count the instances of each move in the specified tree.
- CAVEAT: assumes that root game hasn't any pre-applied moves; which might occur in a test-case.
- CAVEAT: ambiguity remains regarding the move-type (especially any piece taken).
- CAVEAT: a node is counted as just one instance of the move, rather than the number of games which passed through that node. Had the move-frequency been derived from a list of games, a different distribution would result, but then early moves would appear popular rather than just the consequence of limited choice.
Constructor
fromBareGameTree :: BareGameTree -> GameTree Source #
Constructor.