Data.Tree.Game_tree.Game_tree
Description
Nodes in game trees Copyright 2009 Colin Adams
This file is part of game-tree.
Game-tree is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
- class Game_tree a where
- is_terminal :: a -> Bool
- node_value :: a -> Int
- children :: a -> [a]
Documentation
Nodes in a game search tree
Methods
is_terminal :: a -> BoolSource
Is this a game-terminating node (e.g. checkmate)?
Law: is_terminal n == (children n == [])
node_value :: a -> IntSource
Heuristic value of node
Returned value must line in the (inclusive) range (minBound + 4, maxBound - 3) Needs to be sensitive to whose turn it is to move. I.e. it must return values of the opposite sign if the other player is to move.
Child nodes in the game tree (positions more deeply searched)