bishbosh-0.0.0.2: Plays chess.

Safe HaskellNone
LanguageHaskell2010

BishBosh.Cartesian.Ordinate

Contents

Description

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

Synopsis

Constants

yOrigin :: Int Source #

The constant length of the y-axis.

yLength :: Distance Source #

The constant length of the y-axis.

yMin :: Enum y => y Source #

The constant lower bound of the ordinate.

yMax :: Enum y => y Source #

The constant upper bound of the ordinate.

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

The constant list of ordinates.

centre :: Fractional centre => centre Source #

  • The constant centre of the span.
  • CAVEAT: no square actually exists at this fractional value.

Functions

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.

Predicates

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

Predicate.