bishbosh-0.1.4.0: Plays chess.
Safe HaskellNone
LanguageHaskell2010

BishBosh.StateProperty.Seeker

Description

AUTHOR
Dr. Alistair Ward
DESCRIPTION
Permits discovery within a board.
Synopsis

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.

Minimal complete definition

findProximateKnights, findPieces

Methods

findProximateKnights Source #

Arguments

:: seeker 
-> LogicalColour

The logical colour of the Knight for which to search.

-> Coordinates

The destination to which the Knight is required to be capable of jumping.

-> [Coordinates] 

Locate any Knights capable of taking a piece at the specified coordinates.

findPieces Source #

Arguments

:: (Piece -> Bool)

Predicate.

-> seeker 
-> [LocatedPiece] 

Locate any pieces satisfying the specified predicate.

countPawnsByFileByLogicalColour :: seeker -> NPiecesByFileByLogicalColour Source #

  • Counts the number of Pawns 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

Instances details
Seeker MaybePieceByCoordinates Source #
  • Find any Knights of the specified logical colour, in attack-range around the specified coordinates.
  • CAVEAT: nothing is said about whether any piece at the specified coordinates belongs to the opponent, as one might expect.
  • CAVEAT: less efficient than findProximateKnights.
Instance details

Defined in BishBosh.State.MaybePieceByCoordinates

Seeker CoordinatesByRankByLogicalColour Source #
  • Find any Knights of the specified logical colour, in attack-range around the specified coordinates.
  • CAVEAT: nothing is said about whether any piece at the specified coordinates belongs to the opponent, as one might expect.
Instance details

Defined in BishBosh.State.CoordinatesByRankByLogicalColour

Seeker Board Source # 
Instance details

Defined in BishBosh.State.Board

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.