Safe Haskell | None |
---|---|
Language | Haskell2010 |
AUTHOR
- Dr. Alistair Ward
DESCRIPTION
- Defines the data-type which represents the rank of a chess-piece.
CAVEAT
- This term is also commonly used to refer to a row of the board.
Synopsis
- class Promotable a where
- getMaybePromotionRank :: a -> Maybe Rank
- type EvaluateRank rankValue = Rank -> rankValue
- type ByRank = Array Rank
- data Rank
- tag :: String
- flank :: [Rank]
- promotionProspects :: [Rank]
- defaultPromotionRank :: Rank
- plodders :: [Rank]
- fixedAttackRange :: [Rank]
- individuallySufficientMaterial :: [Rank]
- pieces :: [Rank]
- nobility :: [Rank]
- range :: [Rank]
- expendable :: [Rank]
- nDistinctRanks :: NRanks
- compareByLVA :: Ord rankValue => EvaluateRank rankValue -> Rank -> Rank -> Ordering
- listArrayByRank :: IArray a e => [e] -> a Rank e
Type-classes
class Promotable a where Source #
An interface to which data which can represent Pawn
-promotion, can implement.
getMaybePromotionRank :: a -> Maybe Rank Source #
Instances
Promotable MoveType Source # | |
Defined in BishBosh.Attribute.MoveType | |
Promotable (ICCFNumeric x y) Source # | |
Defined in BishBosh.Notation.ICCFNumeric getMaybePromotionRank :: ICCFNumeric x y -> Maybe Rank Source # | |
Promotable (Coordinate x y) Source # | |
Defined in BishBosh.Notation.Coordinate getMaybePromotionRank :: Coordinate x y -> Maybe Rank Source # | |
Promotable (Smith x y) Source # | |
Defined in BishBosh.Notation.Smith |
Types
Type-synonyms
type EvaluateRank rankValue = Rank -> rankValue Source #
The type of a function which returns a rank's value.
Data-types
The component of a chess-piece which is independent of its colour.
Constants
The distinct ranks of the constant ordered range of those pieces of which each side has exactly two.
promotionProspects :: [Rank] Source #
The constant list of distinct rank to which a Pawn
may legally be promoted; though there's no point in promotion to other than Queen
or Knight
.
defaultPromotionRank :: Rank Source #
The rank to which a Pawn
is, in the absence of instruction, promoted.
fixedAttackRange :: [Rank] Source #
The subset of ranks which attack over a fixed range.
individuallySufficientMaterial :: [Rank] Source #
The subset of ranks which lacking support, are sufficient to force checkmate.
The distinct ranks of the pieces from which the back row is composed, i.e. everything except Pawn
s.
The ordered ranks of the pieces from which the back row is composed, including duplicates.
expendable :: [Rank] Source #
Those ranks which can be taken.
nDistinctRanks :: NRanks Source #
The constant number of distinct ranks.
Functions
compareByLVA :: Ord rankValue => EvaluateRank rankValue -> Rank -> Rank -> Ordering Source #
- Given two alternative capture moves, this function compares the rank-value of the aggressors.
- N.B.: a
King
is always considered most valuable, regardless of the evaluation-function supplied.
Constructor
listArrayByRank :: IArray a e => [e] -> a Rank e Source #
An array-constructor.