bishbosh-0.1.4.0: Plays chess.
Safe HaskellNone
LanguageHaskell2010

BishBosh.Cartesian.Abscissa

Description

AUTHOR
Dr. Alistair Ward
DESCRIPTION
  • Describes the x-axis by which the board is indexed.
  • AKA the file 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

xLength :: X Source #

The constant length of the x-axis.

xBounds :: (X, X) Source #

The constant bounds of abscissae.

xRange :: [X] Source #

The constant list of all abscissae.

bishopsFiles :: [X] Source #

The conventional starting files for the Bishops of either logical colour.

kingsFile :: X Source #

The conventional starting file for the King of either logical colour.

Functions

toIx :: X -> Int Source #

Convert to an array-index.

fromIx :: Int -> X Source #

Convert from an array-index.

reflect :: X -> X Source #

Reflects about the mid-point of the axis.

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

Translate the specified ordinate.

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

Where legal, translate the specified abscissa.

getAdjacents :: X -> [X] Source #

Get the abscissae immediately left & right.

Constructors

listArrayByAbscissa :: IArray a e => [e] -> a X e Source #

Array-constructor.

Predicates

inBounds :: X -> Bool Source #

Predicate.