bishbosh-0.1.4.0: Plays chess.
Safe HaskellNone
LanguageHaskell2010

BishBosh.StateProperty.Censor

Description

AUTHOR
Dr. Alistair Ward
DESCRIPTION
Maintains a census of the pieces on the board, without regard to their location.
Synopsis

Types

Type-synonyms

type NPiecesByRank = UArrayByRank NPieces Source #

The difference in the number of pieces of each rank held by either side.

Type-classes

class Censor censor where Source #

An interface which may be implemented by data which can perform a census of the pieces on the board.

Methods

countPiecesByLogicalColour Source #

Arguments

:: censor 
-> (NPieces, NPieces)

The total number of pieces, partitioned into Black & White respectively.

countPieces Source #

Arguments

:: censor 
-> NPieces

The total number of pieces on the board, regardless of logical colour.

countPieceDifferenceByRank Source #

Arguments

:: censor 
-> NPiecesByRank

Finds the difference between the number of pieces of each rank held by each side. N.B. for this purpose, White is arbitrarily considered positive & Black negative.

hasInsufficientMaterial Source #

Arguments

:: censor 
-> Bool

Whether insufficient material remains on the board, to force check-mate; https://en.wikipedia.org/wiki/Draw_(chess).

hasBothKings Source #

Arguments

:: censor 
-> Bool

Whether there's exactly one King of each logical colour.

Functions

findInvalidity :: Censor censor => censor -> [String] Source #

Self-validate.