bishbosh-0.0.0.2: Plays chess.

Safe HaskellNone
LanguageHaskell2010

BishBosh.State.InstancesByPosition

Contents

Description

AUTHOR
Dr. Alistair Ward
DESCRIPTION
Records the number of times each position has been encountered.

Synopsis

Types

Type-synonyms

Constants

leastCyclicPlies :: NMoves Source #

The smallast number of repeatable plies required to form a cycle.

Data-types

data InstancesByPosition position Source #

  • A count of the number of instances of positions which have occurred.
  • Greater than '1' represents a repetition.

Instances

Eq position => Eq (InstancesByPosition position) Source # 

Methods

(==) :: InstancesByPosition position -> InstancesByPosition position -> Bool #

(/=) :: InstancesByPosition position -> InstancesByPosition position -> Bool #

NFData position => NFData (InstancesByPosition position) Source # 

Methods

rnf :: InstancesByPosition position -> () #

(Ord position, ReflectableOnX position) => ReflectableOnX (InstancesByPosition position) Source # 

Functions

countConsecutiveRepeatablePlies :: InstancesByPosition position -> NMoves Source #

Count the total number of consecutive repeatable plies amongst recent moves.

countPositionRepetitions :: InstancesByPosition position -> NBoards Source #

Count the total number of repetitions of positions.

getNDistinctPositions :: InstancesByPosition position -> NBoards Source #

The number of distinct positions.

Constructors

mkInstancesByPosition :: NBoardsByPosition position -> InstancesByPosition position Source #

Smart constructor.

mkSingleton :: position -> InstancesByPosition position Source #

Constructor.

Mutators

insertPosition Source #

Arguments

:: Ord position 
=> Bool

Whether the turn which led to the specified position, was repeatable.

-> position 
-> Transformation position 

Insert a position into the collection.

deletePosition :: Ord position => position -> Transformation position Source #

Remove a position from the collection, as required to implement rollback.

Predicates

anyInstancesByPosition :: (NBoards -> Bool) -> InstancesByPosition position -> Bool Source #

Predicate: apply the specified predicate to the map.