bishbosh-0.0.0.3: Plays chess.

Safe Haskell None Haskell2010

BishBosh.Attribute.MoveType

Description

AUTHOR
Dr. Alistair Ward
DESCRIPTION
Categorises moves, & provides ancillary information as required.

Synopsis

# Types

## Data-types

data MoveType Source #

Classifies the distinct types of move.

Constructors

 Castle IsShort Castling between the King & one of its Rooks. EnPassant Capture by a Pawn of a Pawn as it advanced two squares. Normal (Maybe Rank) (Maybe Rank)

Instances

 Source # Methods Source # Methods Source # MethodsshowList :: [MoveType] -> ShowS # Source # Methodsrnf :: MoveType -> () # Source # Methods Source # Methods

# Constants

Used to qualify output.

Constant value required to denote a short castle.

Constant value required to denote a long castle.

Constant.

# Functions

nPiecesMutator :: Enum nPieces => MoveType -> nPieces -> nPieces Source #

Returns the mutator required to adjust the number of pieces after a move.

## Constructors

Arguments

 :: Maybe Rank The rank of any opposing piece which was just taken. -> Maybe Rank The rank to which a Pawn was just promoted. -> Maybe MoveType Maybe the required move-type.

Smart-constructor for normal move-types.

Arguments

 :: Maybe Rank The rank of any opposing piece which is to be taken. -> Maybe Rank The rank to which a Pawn is to be promoted. -> MoveType

Smart-constructor for normal move-types.

## Predicates

Predicate.

Predicate.

Whether a piece was captured, including Pawns taken En-passant.

Whether the move includes Pawn-promotion.

• Whether the move can't be a member of a repeated cycle.
• CAVEAT: one can't infer from a negative result that the move can be repeated, since the mover may have been a Pawn.

## Query

Query whether a piece was explicitly taken, excluding Pawns taken En-passant.

Query whether a piece was taken either explicitly, or implicitly during En-passant.