Safe Haskell | None |
---|---|
Language | Haskell2010 |
AUTHOR
- Dr. Alistair Ward
DESCRIPTION
- Maintains a census of the pieces on the board, without regard to their location.
Synopsis
- type NPiecesByRank = ArrayByRank NPieces
- class Censor censor where
- countPiecesByLogicalColour :: censor -> (NPieces, NPieces)
- countPieces :: censor -> NPieces
- countPieceDifferenceByRank :: censor -> NPiecesByRank
- hasInsufficientMaterial :: censor -> Bool
- hasBothKings :: censor -> Bool
Types
Type-synonyms
type NPiecesByRank = ArrayByRank 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.
countPiecesByLogicalColour Source #
:: censor | |
-> (NPieces, NPieces) | The total number of pieces, partitioned into |
:: censor | |
-> NPieces | The total number of pieces on the board, regardless of logical colour. |
countPieceDifferenceByRank Source #
:: censor | |
-> NPiecesByRank | Finds the difference between the number of pieces of each rank held by each side. N.B. for this purpose, |
hasInsufficientMaterial Source #
:: censor | |
-> Bool | Whether insufficient material remains on the board, to force check-mate; https://en.wikipedia.org/wiki/Draw_(chess). |
:: censor | |
-> Bool | Whether there's exactly one |