bishbosh-0.0.0.1: Plays chess.

Safe HaskellNone
LanguageHaskell2010

BishBosh.Attribute.Rank

Contents

Description

AUTHOR
Dr. Alistair Ward
DESCRIPTION
Defines the data-type which represents the rank of a chess-piece; cf. a row of the board.

Synopsis

Type-classes

class Promotable a where Source #

An interface to which data which can represent Pawn-promotion, can implement.

Minimal complete definition

getMaybePromotionRank

Types

Type-synonyms

type EvaluateRank rankValue = Rank -> rankValue Source #

The type of a function which returns a Rank's value.

type ByRank = Array Rank Source #

A boxed array indexed by rank, of arbitrary values.

Data-types

data Rank Source #

That part of the difference between chess-pieces which is independent of their logical colour.

Constructors

Pawn 
Rook 
Knight 
Bishop 
Queen 
King 

Instances

Constants

tag :: String Source #

Used to qualify XML.

flank :: [Rank] Source #

The distinct ranks of the constant ordered range of those pieces of which each side has 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 #

Constant rank to which a Pawn is, in the absence of instruction, promoted.

plodders :: [Rank] Source #

The subset of ranks which can only move in single steps.

fixedAttackRange :: [Rank] Source #

The subset of ranks which attack over a fixed range.

individuallySufficientMaterial :: [Rank] Source #

The subset of ranks which (unsupported) are sufficient to force checkmate.

pieces :: [Rank] Source #

A subset of ranks, which excludes Pawn .

nobility :: [Rank] Source #

The ranks of the constant ordered back row of pieces, including duplicates.

range :: [Rank] Source #

The constant ascending list of all ranks.

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 #

  • Compares the rank-value of 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 #

Array-constructor.