Safe Haskell | None |
---|---|
Language | Haskell2010 |
AUTHOR
- Dr. Alistair Ward
DESCRIPTION
- Permits discovery within a board.
Synopsis
- type NPiecesByFileByLogicalColour = ArrayByLogicalColour NPiecesByFile
- class Seeker seeker where
- findProximateKnights :: seeker -> LogicalColour -> Coordinates -> [Coordinates]
- findPieces :: (Piece -> Bool) -> seeker -> [LocatedPiece]
- countPawnsByFileByLogicalColour :: seeker -> NPiecesByFileByLogicalColour
- accumulatePawnsByFile :: X -> NPiecesByFile -> NPiecesByFile
- findAllPieces :: Seeker seeker => seeker -> [LocatedPiece]
- summariseNPawnsByLogicalColour :: Seeker seeker => seeker -> ArrayByLogicalColour NPieces
- findInvalidity :: Seeker seeker => seeker -> [String]
Types
Type-synonyms
type NPiecesByFileByLogicalColour = ArrayByLogicalColour NPiecesByFile Source #
The number of pieces in each file, for each logical colour.
Type-classes
class Seeker seeker where Source #
An interface which may be implemented by data which can search the board.
:: seeker | |
-> LogicalColour | The logical colour of the |
-> Coordinates | The destination to which the |
-> [Coordinates] |
Locate any Knight
s capable of taking a piece at the specified coordinates.
:: (Piece -> Bool) | Predicate. |
-> seeker | |
-> [LocatedPiece] |
Locate any pieces satisfying the specified predicate.
countPawnsByFileByLogicalColour :: seeker -> NPiecesByFileByLogicalColour Source #
- Counts the number of
Pawn
s of each logical colour with similar x-coordinates; their y-coordinate is irrelevant. - N.B.: files lacking any
Pawn
, don't feature in the results.
Instances
Functions
accumulatePawnsByFile :: X -> NPiecesByFile -> NPiecesByFile Source #
Add a Pawn's file to the map.
findAllPieces :: Seeker seeker => seeker -> [LocatedPiece] Source #
Locate all pieces on the board.
summariseNPawnsByLogicalColour :: Seeker seeker => seeker -> ArrayByLogicalColour NPieces Source #
Resolves NPiecesByFileByLogicalColour
into the total number of Pawns on either side.
findInvalidity :: Seeker seeker => seeker -> [String] Source #
Self-validate.