bishbosh-0.1.1.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

Types

Constants

yOrigin :: Int Source #

The position of the origin on the y-axis.

yLength :: Distance Source #

The constant length of the y-axis.

yMin :: Enum y => y Source #

The constant lower bound of ordinates.

yMax :: Enum y => y Source #

The constant upper bound of ordinates.

yBounds :: Enum y => (y, y) Source #

The constant bounds of ordinates.

yRange :: Enum y => [y] Source #

The constant list of all ordinates.

Functions

toIx :: Enum y => y -> Int Source #

Convert to an array-index.

fromIx :: Enum y => Int -> y Source #

Convert from an array-index.

firstRank :: Enum y => LogicalColour -> y Source #

The rank from which pieces conventionally start.

lastRank :: Enum y => LogicalColour -> y Source #

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

pawnsFirstRank :: Enum y => LogicalColour -> y Source #

The rank from which Pawns conventionally start.

enPassantRank :: Enum y => LogicalColour -> y Source #

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

reflect :: Enum y => y -> y Source #

Reflects about the mid-point of the axis.

translate :: (Enum y, Ord y) => (y -> y) -> y -> y Source #

Translate the specified ordinate.

maybeTranslate :: (Enum y, Ord y) => (y -> y) -> y -> Maybe y Source #

Where legal, translate the specified ordinate.

Constructors

Predicates

inBounds :: (Enum y, Ord y) => y -> Bool Source #

Predicate.