bishbosh-0.1.2.0: Plays chess.
Safe HaskellNone
LanguageHaskell2010

BishBosh.State.CoordinatesByRankByLogicalColour

Description

AUTHOR
Dr. Alistair Ward
DESCRIPTION
Synopsis

Types

Type-synonyms

type CoordinatesByLogicalColour = ArrayByLogicalColour [Coordinates] Source #

A list of coordinates for each logical colour.

Data-types

data CoordinatesByRankByLogicalColour Source #

  • This structure allows one to determine the set of coordinates where a type of piece is located.
  • CAVEAT: the list of coordinates is unordered, so test for equality using deconstruct . sortCoordinates .

Instances

Instances details
NFData CoordinatesByRankByLogicalColour Source # 
Instance details

Defined in BishBosh.State.CoordinatesByRankByLogicalColour

Censor CoordinatesByRankByLogicalColour Source # 
Instance details

Defined in BishBosh.State.CoordinatesByRankByLogicalColour

Hashable CoordinatesByRankByLogicalColour Source # 
Instance details

Defined in BishBosh.State.CoordinatesByRankByLogicalColour

Methods

listRandoms :: CoordinatesByRankByLogicalColour -> Zobrist positionHash -> [positionHash] Source #

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

Accountant CoordinatesByRankByLogicalColour Source # 
Instance details

Defined in BishBosh.State.CoordinatesByRankByLogicalColour

Methods

sumPieceSquareValueByLogicalColour :: Num pieceSquareValue => PieceSquareByCoordinatesByRank pieceSquareValue -> NPieces -> CoordinatesByRankByLogicalColour -> [pieceSquareValue] Source #

Functions

findPiecesOfColour Source #

Arguments

:: LogicalColour

The logical colour of the pieces to find.

-> CoordinatesByRankByLogicalColour 
-> [LocatedPiece] 

Locate all pieces of the specified logical colour.

assocs :: CoordinatesByRankByLogicalColour -> [(Piece, [Coordinates])] Source #

Build an association-list.

Accessors

getKingsCoordinates Source #

Arguments

:: LogicalColour

The logical colour of the King to find.

-> CoordinatesByRankByLogicalColour 
-> Coordinates 

Get the coordinates of the King of the specified logical colour.

Constructor

Mutators

movePiece Source #

Arguments

:: Move 
-> Piece

The piece which moved.

-> Maybe Rank

The (possibly promoted) rank to place at the destination.

-> Either Coordinates (Maybe Rank)

Either the destination of any passed Pawn, or the rank of any piece taken.

-> Transformation 

Adjust the array to reflect a new move.

sortCoordinates :: Transformation Source #

Independently sort each list of coordinates.