zcache-0.0.0: Zobrist keys for game state tracking

Data.ZCache

Description

Zobrist keys compactly represent the state of perfect information games.

Synopsis

Documentation

data ZSet a Source

Sets of board states, indexed by zobrist keys

Constructors

ZSet Word64 (ZArray a) (Set Word64) 

Instances

Ix a => Eq (ZSet a) 
(Show a, Ix a) => Show (ZSet a) 

data ZMap k v Source

Maps from board states, indexed by zobrist keys

Constructors

ZMap Word64 (ZArray k) (Map Word64 v) 

Instances

(Eq v, Ix k) => Eq (ZMap k v) 
(Show k, Show v, Ix k) => Show (ZMap k v) 

zSetSource

Arguments

:: Ix a 
=> Word64

Seed to use for random number generation

-> (a, a)

Bounds for piece position values

-> Int

Total number of piece positions

-> ZSet a 

Construct a ZSet

zMapSource

Arguments

:: forall a b . Ix a 
=> Word64

Seed to use for random number generation

-> (a, a)

Bounds for piece position values

-> Int

Total number of piece positions

-> ZMap a b 

Construct a ZMap

flipPosSource

Arguments

:: Ix a 
=> a

Most recent move in the game

-> ZSet a

The set to insert into

-> Maybe (ZSet a)

Final set or Nothing if the board state exists already

zArray :: Ix a => Word64 -> (a, a) -> Int -> ZArray aSource

Create the internal array used for the zobrist key creation