bishbosh-0.1.4.0: Plays chess.
Safe HaskellNone
LanguageHaskell2010

BishBosh.Cartesian.Ordinate

Description

AUTHOR
Dr. Alistair Ward
DESCRIPTION
  • Describes the y-axis by which the board is indexed.
  • AKA the rank of a piece.
  • N.B. this coordinate-system is for internal use only, and doesn't attempt to replicate any standard chess-notation.
Synopsis

Constants

yLength :: Y Source #

The constant length of the y-axis.

yBounds :: (Y, Y) Source #

The constant bounds of ordinates.

yRange :: [Y] Source #

The constant list of all ordinates.

Functions

toIx :: Y -> Int Source #

Convert to an array-index.

fromIx :: Int -> Y Source #

Convert from an array-index.

firstRank :: LogicalColour -> Y Source #

The rank from which pieces conventionally start.

lastRank :: LogicalColour -> Y Source #

The final rank; i.e. the one on which a Pawn is promoted.

pawnsFirstRank :: LogicalColour -> Y Source #

The rank from which Pawns conventionally start.

enPassantRank :: LogicalColour -> Y Source #

The rank from which a Pawn may capture en-passant.

reflect :: Y -> Y Source #

Reflects about the mid-point of the axis.

translate :: (Y -> Y) -> Y -> Y Source #

Translate the specified ordinate.

maybeTranslate :: (Y -> Y) -> Y -> Maybe Y Source #

Where legal, translate the specified ordinate.

Predicates

inBounds :: Y -> Bool Source #

Predicate.