Safe Haskell | None |
---|---|
Language | Haskell2010 |
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
- data PieceSquareByCoordinatesByRank
- nPiecesBounds :: (NPieces, NPieces)
- gnuPlotComment :: Char
- findPieceSquareValue :: PieceSquareByCoordinatesByRank -> NPieces -> LogicalColour -> Rank -> Coordinates -> PieceSquareValue
- interpolatePieceSquareValues :: PieceSquareValue -> PieceSquareValue -> PieceSquareValueByNPieces
- formatForGNUPlot :: PieceSquareByCoordinatesByRank -> (PieceSquareValue -> ShowS) -> ShowS -> (PieceSquareValueByNPieces -> PieceSquareValue) -> ShowS
- mkPieceSquareByCoordinatesByRank :: (Rank -> EitherPieceSquareValueByNPiecesByCoordinates) -> PieceSquareByCoordinatesByRank
Types
Type-synonyms
Data-types
data PieceSquareByCoordinatesByRank Source #
The value for each type of piece of occupying each coordinate, at each stage in the lifetime of the game.
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
:: PieceSquareByCoordinatesByRank | |
-> NPieces | The progress through the game. |
-> LogicalColour | The piece's logical colour. |
-> Rank | The piece's rank. |
-> Coordinates | The piece's location. |
-> 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.
interpolatePieceSquareValues Source #
:: PieceSquareValue | Opening-game. |
-> PieceSquareValue | End-game. |
-> PieceSquareValueByNPieces |
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.
:: PieceSquareByCoordinatesByRank | |
-> (PieceSquareValue -> ShowS) | Format a pieceSquareValue. |
-> ShowS | The column-delimiter. |
-> (PieceSquareValueByNPieces -> PieceSquareValue) | Select one PieceSquareValue from interpolated values. |
-> ShowS |
Format the data for input to GNUPlot.
Constructor
mkPieceSquareByCoordinatesByRank Source #
:: (Rank -> EitherPieceSquareValueByNPiecesByCoordinates) | Convert a rank into either (a pieceSquareValue or a pieceSquareValue which linearly varies with the number of pieces remaining) by coordinates. |
-> PieceSquareByCoordinatesByRank |
Constructor.