Safe Haskell | None |
---|---|
Language | Haskell2010 |
AUTHOR
- Dr. Alistair Ward
DESCRIPTION
- The details of a player's turn.
Synopsis
- data Turn x y
- compareByLVA :: Ord rankValue => EvaluateRank rankValue -> Turn x y -> Turn x y -> Ordering
- compareByMVVLVA :: Ord rankValue => EvaluateRank rankValue -> Turn x y -> Turn x y -> Ordering
- mkTurn :: QualifiedMove x y -> Rank -> Turn x y
- isCapture :: Turn x y -> Bool
- isPawnDoubleAdvance :: (Enum x, Enum y, Eq y) => LogicalColour -> Turn x y -> Bool
Types
Data-types
- Defines one turn of a player.
- Additional data is recorded to facilitate both rollback & recording of the move in various conventional notations.
Instances
(Eq x, Eq y) => Eq (Turn x y) Source # | |
(Enum x, Enum y, Ord x, Ord y, Read x, Read y) => Read (Turn x y) Source # | |
(Show x, Show y) => Show (Turn x y) Source # | |
(NFData x, NFData y) => NFData (Turn x y) Source # | |
Defined in BishBosh.Component.Turn | |
Enum y => ReflectableOnX (Turn x y) Source # | |
Defined in BishBosh.Component.Turn reflectOnX :: Turn x y -> Turn x y Source # | |
(Enum x, Enum y) => ShowNotation (Turn x y) Source # | |
Defined in BishBosh.Notation.MoveNotation showsNotation :: MoveNotation -> Turn x y -> ShowS Source # |
Functions
compareByLVA :: Ord rankValue => EvaluateRank rankValue -> Turn x y -> Turn x y -> Ordering Source #
Forwards the request to compareByLVA
.
compareByMVVLVA :: Ord rankValue => EvaluateRank rankValue -> Turn x y -> Turn x y -> Ordering Source #
- Compares turns by https://chessprogramming.wikispaces.com/MVV-LVA.
- This orders the most valuable victim of an attack first, but when victims are of equal rank, orders the least valuable aggressor first.
- N.B.: the order of non-capture moves (including promotions) isn't defined.
- CAVEAT: no account is made for any defenders of the attacked piece, which might recoup transient gains.
Constructor
Predicates
isPawnDoubleAdvance :: (Enum x, Enum y, Eq y) => LogicalColour -> Turn x y -> Bool Source #
Whether the turn represents a Pawn
's initial two-square advance.