bishbosh-0.1.2.0: Plays chess.
Safe HaskellNone
LanguageHaskell2010

BishBosh.Component.Turn

Description

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

Types

Data-types

data Turn Source #

  • Defines one turn of a player.
  • Additional data is recorded to facilitate both rollback & recording of the move in various conventional notations.

Instances

Instances details
Eq Turn Source # 
Instance details

Defined in BishBosh.Component.Turn

Methods

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

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

Read Turn Source # 
Instance details

Defined in BishBosh.Component.Turn

Show Turn Source # 
Instance details

Defined in BishBosh.Component.Turn

Methods

showsPrec :: Int -> Turn -> ShowS #

show :: Turn -> String #

showList :: [Turn] -> ShowS #

NFData Turn Source # 
Instance details

Defined in BishBosh.Component.Turn

Methods

rnf :: Turn -> () #

ReflectableOnX Turn Source # 
Instance details

Defined in BishBosh.Component.Turn

Methods

reflectOnX :: Turn -> Turn Source #

ShowNotation Turn Source # 
Instance details

Defined in BishBosh.Notation.MoveNotation

Functions

compareByLVA :: EvaluateRank -> Turn -> Turn -> Ordering Source #

Forwards the request to compareByLVA.

compareByMVVLVA :: EvaluateRank -> Turn -> Turn -> Ordering Source #

  • Compares turns by https://www.chessprogramming.org/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 -> Rank -> Turn Source #

Smart constructor.

Predicates

isCapture :: Turn -> Bool Source #

Convenience.

isPawnDoubleAdvance Source #

Arguments

:: LogicalColour

Defines the side whose turn is referenced.

-> Turn 
-> Bool 

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