bishbosh-0.0.0.4: Plays chess.

Safe HaskellNone
LanguageHaskell2010

BishBosh.Component.Turn

Contents

Description

AUTHOR
Dr. Alistair Ward
DESCRIPTION
The details of a player's turn.
Synopsis

Types

Data-types

data Turn x y Source #

  • 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 # 
Instance details

Defined in BishBosh.Component.Turn

Methods

(==) :: Turn x y -> Turn x y -> Bool #

(/=) :: Turn x y -> Turn x y -> Bool #

(Enum x, Enum y, Ord x, Ord y, Read x, Read y) => Read (Turn x y) Source # 
Instance details

Defined in BishBosh.Component.Turn

Methods

readsPrec :: Int -> ReadS (Turn x y) #

readList :: ReadS [Turn x y] #

readPrec :: ReadPrec (Turn x y) #

readListPrec :: ReadPrec [Turn x y] #

(Show x, Show y) => Show (Turn x y) Source # 
Instance details

Defined in BishBosh.Component.Turn

Methods

showsPrec :: Int -> Turn x y -> ShowS #

show :: Turn x y -> String #

showList :: [Turn x y] -> ShowS #

(NFData x, NFData y) => NFData (Turn x y) Source # 
Instance details

Defined in BishBosh.Component.Turn

Methods

rnf :: Turn x y -> () #

Enum y => ReflectableOnX (Turn x y) Source # 
Instance details

Defined in BishBosh.Component.Turn

Methods

reflectOnX :: Turn x y -> Turn x y Source #

(Enum x, Enum y) => ShowNotation (Turn x y) Source # 
Instance details

Defined in BishBosh.Notation.MoveNotation

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

mkTurn :: QualifiedMove x y -> Rank -> Turn x y Source #

Smart constructor.

Predicates

isCapture :: Turn x y -> Bool Source #

Convenience.

isPawnDoubleAdvance :: (Enum x, Enum y, Eq y) => LogicalColour -> Turn x y -> Bool Source #

Whether the turn represents a Pawn's initial two-square advance.