bishbosh-0.0.0.2: Plays chess.

Safe HaskellNone
LanguageHaskell2010

BishBosh.State.Censor

Contents

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 = ByRank 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.

countPieces Source #

Arguments

:: censor 
-> NPieces

The total number of pieces on the board.

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.