bishbosh-0.1.1.0: Plays chess.
Safe HaskellNone
LanguageHaskell2010

BishBosh.StateProperty.Seeker

Description

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

Type-classes

class Seeker seeker x y where Source #

An interface which may be implemented by data which can search the board.

Methods

findProximateKnights Source #

Arguments

:: LogicalColour

The logical colour of the Knight for which to search.

-> Coordinates x y

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

-> seeker x y 
-> [Coordinates x y] 

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

findPieces Source #

Arguments

:: (Piece -> Bool)

Predicate.

-> seeker x y 
-> [LocatedPiece x y] 

Locate any pieces satisfying the specified predicate.

Instances

Instances details
(Enum x, Enum y, Ord x, Ord y) => Seeker MaybePieceByCoordinates x y 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

(Enum x, Enum y, Ord x, Ord y) => Seeker CoordinatesByRankByLogicalColour x y 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

(Enum x, Enum y, Ord x, Ord y) => Seeker Board x y Source # 
Instance details

Defined in BishBosh.State.Board

Functions

findAllPieces :: Seeker seeker x y => seeker x y -> [LocatedPiece x y] Source #

Locate all pieces on the board.