bishbosh-0.1.1.0: Plays chess.
Safe HaskellNone
LanguageHaskell2010

BishBosh.Component.PieceSquareByCoordinatesByRank

Description

AUTHOR
Dr. Alistair Ward
DESCRIPTION
Defines the relative value of a specific rank of piece, occupying a specific coordinate on the board, at a specific stage in the game.
Synopsis

Types

Type-synonyms

type FindPieceSquareValue x y pieceSquareValue Source #

Arguments

 = LogicalColour

The piece's logical colour.

-> Rank

The piece's rank.

-> Coordinates x y

The piece's location.

-> pieceSquareValue 

The type of a function which can find the required piece-square value.

type FindPieceSquareValues x y pieceSquareValue Source #

Arguments

 = LogicalColour

The piece's logical colour.

-> Rank

The piece's rank.

-> [Coordinates x y]

The locations of interest for the piece.

-> [pieceSquareValue] 

The type of a function which can find the required piece-square values.

Data-types

data PieceSquareByCoordinatesByRank x y pieceSquareValue Source #

The value for each type of piece of occupying each coordinate, at each stage in the lifetime of the game.

Instances

Instances details
(Enum x, Enum y, Ord x, Ord y, Eq pieceSquareValue) => Eq (PieceSquareByCoordinatesByRank x y pieceSquareValue) Source # 
Instance details

Defined in BishBosh.Component.PieceSquareByCoordinatesByRank

Methods

(==) :: PieceSquareByCoordinatesByRank x y pieceSquareValue -> PieceSquareByCoordinatesByRank x y pieceSquareValue -> Bool #

(/=) :: PieceSquareByCoordinatesByRank x y pieceSquareValue -> PieceSquareByCoordinatesByRank x y pieceSquareValue -> Bool #

(Enum x, Enum y, Ord x, Ord y, Show x, Show y, Show pieceSquareValue) => Show (PieceSquareByCoordinatesByRank x y pieceSquareValue) Source # 
Instance details

Defined in BishBosh.Component.PieceSquareByCoordinatesByRank

Methods

showsPrec :: Int -> PieceSquareByCoordinatesByRank x y pieceSquareValue -> ShowS #

show :: PieceSquareByCoordinatesByRank x y pieceSquareValue -> String #

showList :: [PieceSquareByCoordinatesByRank x y pieceSquareValue] -> ShowS #

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

Defined in BishBosh.Component.PieceSquareByCoordinatesByRank

Methods

rnf :: PieceSquareByCoordinatesByRank x y pieceSquareValue -> () #

Constants

nPiecesBounds :: (NPieces, NPieces) Source #

The bounds of the number of pieces on the board, at the end-game & opening-game respectively.

gnuPlotComment :: Char Source #

The character used in GNUPlot to denote a comment.

Functions

findPieceSquareValue Source #

Arguments

:: (Enum x, Enum y, Ord x, Ord y) 
=> NPieces

The progress through the game.

-> LogicalColour

The piece's logical colour.

-> Rank

The piece's rank.

-> Coordinates x y

The piece's location.

-> PieceSquareByCoordinatesByRank x y pieceSquareValue 
-> pieceSquareValue 

Find the piece-square value, at a stage in the game's lifetime defined by the total number of pieces remaining, for the specified rank & coordinates.

findPieceSquareValues Source #

Arguments

:: (Enum x, Enum y, Ord x, Ord y) 
=> NPieces

The progress through the game.

-> LogicalColour

The piece's logical colour.

-> Rank

The piece's rank.

-> [Coordinates x y]

The locations of interest for the specified piece.

-> PieceSquareByCoordinatesByRank x y pieceSquareValue 
-> [pieceSquareValue] 

Find the piece-square values, at a stage in the game's lifetime defined by the total number of pieces remaining, for the specified rank & list of coordinates.

interpolatePieceSquareValues Source #

Arguments

:: Fractional pieceSquareValue 
=> pieceSquareValue

Opening-game.

-> pieceSquareValue

End-game.

-> PieceSquareValueByNPieces pieceSquareValue 

Given the bounds over which two piece-square values vary as the game progresses from opening to end, return linearly interpolated values for all stages.

formatForGNUPlot Source #

Arguments

:: (Enum x, Enum y, Ord x, Ord y) 
=> (pieceSquareValue -> ShowS)

Format a pieceSquareValue.

-> ShowS

The column-delimiter.

-> (PieceSquareValueByNPieces pieceSquareValue -> pieceSquareValue)

Select one pieceSquareValue from interpolated values.

-> PieceSquareByCoordinatesByRank x y pieceSquareValue 
-> ShowS 

Format the data for input to GNUPlot.

Constructor

mkPieceSquareByCoordinatesByRank Source #

Arguments

:: (Rank -> EitherPieceSquareValueByNPiecesByCoordinates x y pieceSquareValue)

Convert a rank into either (a pieceSquareValue or a pieceSquareValue which linearly varies with the number of pieces remaining) by coordinates.

-> PieceSquareByCoordinatesByRank x y pieceSquareValue 

Constructor.