Safe Haskell | None |
---|---|
Language | Haskell2010 |
AUTHOR
- Dr. Alistair Ward
DESCRIPTION
- https://www.chessprogramming.org/Zobrist_Hashing.
- Defines the random-numbers required to construct a hash of a chess-position.
- Facilitates the construction of a hash from arbitrary data.
Synopsis
- data Zobrist positionHash
- dereferenceRandomByCoordinatesByRankByLogicalColour :: Zobrist positionHash -> Index -> positionHash
- dereferenceRandomByCastleableRooksXByLogicalColour :: Zobrist positionHash -> LogicalColour -> X -> Maybe positionHash
- dereferenceRandomByEnPassantAbscissa :: Zobrist positionHash -> X -> positionHash
- mkZobrist :: (FiniteBits positionHash, RandomGen randomGen, Random positionHash) => Maybe Int -> randomGen -> Zobrist positionHash
Types
Type-synonyms
Data-types
data Zobrist positionHash Source #
The random numbers used to generate a hash, which almost uniquely represent a position.
Instances
Foldable Zobrist Source # | |
Defined in BishBosh.Component.Zobrist fold :: Monoid m => Zobrist m -> m # foldMap :: Monoid m => (a -> m) -> Zobrist a -> m # foldMap' :: Monoid m => (a -> m) -> Zobrist a -> m # foldr :: (a -> b -> b) -> b -> Zobrist a -> b # foldr' :: (a -> b -> b) -> b -> Zobrist a -> b # foldl :: (b -> a -> b) -> b -> Zobrist a -> b # foldl' :: (b -> a -> b) -> b -> Zobrist a -> b # foldr1 :: (a -> a -> a) -> Zobrist a -> a # foldl1 :: (a -> a -> a) -> Zobrist a -> a # elem :: Eq a => a -> Zobrist a -> Bool # maximum :: Ord a => Zobrist a -> a # minimum :: Ord a => Zobrist a -> a # | |
Show positionHash => Show (Zobrist positionHash) Source # | |
(FiniteBits positionHash, Random positionHash) => Default (Zobrist positionHash) Source # | |
Defined in BishBosh.Component.Zobrist |
Functions
dereferenceRandomByCoordinatesByRankByLogicalColour :: Zobrist positionHash -> Index -> positionHash Source #
Dereferences getRandomByCoordinatesByRankByLogicalColour
using the specified index.
dereferenceRandomByCastleableRooksXByLogicalColour Source #
:: Zobrist positionHash | |
-> LogicalColour | |
-> X | |
-> Maybe positionHash | The existence of a result depends on whether there remain any Rooks which can castle. |
Dereferences getRandomByCastleableRooksXByLogicalColour
using the specified abscissa.
dereferenceRandomByEnPassantAbscissa :: Zobrist positionHash -> X -> positionHash Source #
Dereferences getRandomByEnPassantAbscissa
using the specified abscissa.