Safe Haskell | None |
---|---|
Language | Haskell2010 |
AUTHOR
- Dr. Alistair Ward
DESCRIPTION
- https://chessprogramming.wikispaces.com/Zobrist+Hashing.
- Defines the random-numbers required to construct a hash of a chess-position.
- Facilitates the construction of a hash from arbitrary data.
- class Hashable1D hashable x where
- class Hashable2D hashable x y where
- data Zobrist x y positionHash
- dereferenceRandomByCoordinatesByRankByLogicalColour :: (Enum x, Enum y, Ord x, Ord y) => LogicalColour -> Rank -> Coordinates x y -> Zobrist x y positionHash -> positionHash
- dereferenceRandomByCastleableRooksXByLogicalColour :: Eq x => LogicalColour -> x -> Zobrist x y positionHash -> Maybe positionHash
- dereferenceRandomByEnPassantAbscissa :: Ix x => x -> Zobrist x y positionHash -> positionHash
- hash2D :: (Bits positionHash, Hashable2D hashable x y) => hashable x y -> Zobrist x y positionHash -> positionHash
- combine :: Bits positionHash => positionHash -> [positionHash] -> positionHash
- mkZobrist :: (Ix x, FiniteBits positionHash, Enum x, Enum y, Num positionHash, Ord y, RandomGen randomGen, Random positionHash) => Maybe Int -> randomGen -> Zobrist x y positionHash
Type-classes
class Hashable1D hashable x where Source #
An interface to which 1-D hashable data can conform.
listRandoms1D :: hashable x -> Zobrist x y positionHash -> [positionHash] Source #
Ix x => Hashable1D EnPassantAbscissa x Source # | |
Eq x => Hashable1D CastleableRooksByLogicalColour x Source # | Get the list of random numbers required to represent the current castling potential. |
class Hashable2D hashable x y where Source #
An interface to which 2-D hashable data can conform.
listRandoms2D :: hashable x y -> Zobrist x y positionHash -> [positionHash] Source #
(Enum x, Enum y, Ord x, Ord y) => Hashable2D MaybePieceByCoordinates x y Source # | |
(Enum x, Enum y, Ord x, Ord y) => Hashable2D CoordinatesByRankByLogicalColour x y Source # | |
(Enum x, Enum y, Ord x, Ord y) => Hashable2D Board x y Source # | |
(Ix x, Enum x, Enum y, Ord y) => Hashable2D Position x y Source # | |
(Ix x, Enum x, Enum y, Ord y) => Hashable2D Game x y Source # | |
Types
Data-types
data Zobrist x y positionHash Source #
The random numbers used to generate a hash, which almost uniquely represent a position.
Constants
Functions
dereferenceRandomByCoordinatesByRankByLogicalColour :: (Enum x, Enum y, Ord x, Ord y) => LogicalColour -> Rank -> Coordinates x y -> Zobrist x y positionHash -> positionHash Source #
Dereference getRandomByCoordinatesByRankByLogicalColour
.
dereferenceRandomByCastleableRooksXByLogicalColour :: Eq x => LogicalColour -> x -> Zobrist x y positionHash -> Maybe positionHash Source #
Dereference getRandomByCastleableRooksXByLogicalColour
.
dereferenceRandomByEnPassantAbscissa :: Ix x => x -> Zobrist x y positionHash -> positionHash Source #
Dereference getRandomByEnPassantAbscissa
.
hash2D :: (Bits positionHash, Hashable2D hashable x y) => hashable x y -> Zobrist x y positionHash -> positionHash Source #
Resolve a hashable into a hash.
combine :: Bits positionHash => positionHash -> [positionHash] -> positionHash Source #
Include a list of random numbers in the hash.