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
- type FindPieceSquareValue x y pieceSquareValue = LogicalColour -> Rank -> Coordinates x y -> pieceSquareValue
- type FindPieceSquareValues x y pieceSquareValue = LogicalColour -> Rank -> [Coordinates x y] -> [pieceSquareValue]
- data PieceSquareByCoordinatesByRank x y pieceSquareValue
- nPiecesBounds :: (NPieces, NPieces)
- gnuPlotComment :: Char
- findPieceSquareValue :: (Enum x, Enum y, Ord x, Ord y) => NPieces -> LogicalColour -> Rank -> Coordinates x y -> PieceSquareByCoordinatesByRank x y pieceSquareValue -> pieceSquareValue
- findPieceSquareValues :: (Enum x, Enum y, Ord x, Ord y) => NPieces -> LogicalColour -> Rank -> [Coordinates x y] -> PieceSquareByCoordinatesByRank x y pieceSquareValue -> [pieceSquareValue]
- interpolatePieceSquareValues :: Fractional pieceSquareValue => pieceSquareValue -> pieceSquareValue -> PieceSquareValueByNPieces pieceSquareValue
- formatForGNUPlot :: (Enum x, Enum y, Ord x, Ord y) => (pieceSquareValue -> ShowS) -> ShowS -> (PieceSquareValueByNPieces pieceSquareValue -> pieceSquareValue) -> PieceSquareByCoordinatesByRank x y pieceSquareValue -> ShowS
- mkPieceSquareByCoordinatesByRank :: (Rank -> EitherPieceSquareValueByNPiecesByCoordinates x y pieceSquareValue) -> PieceSquareByCoordinatesByRank x y pieceSquareValue
Types
Type-synonyms
type FindPieceSquareValue x y pieceSquareValue Source #
= 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 #
= 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
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
:: (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 #
:: (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 #
:: 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.
:: (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 #
:: (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.