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 pieceSquareValue
- nPiecesBounds :: (NPieces, NPieces)
- gnuPlotComment :: Char
- findPieceSquareValue :: PieceSquareByCoordinatesByRank pieceSquareValue -> NPieces -> LogicalColour -> Rank -> Coordinates -> pieceSquareValue
- interpolatePieceSquareValues :: Fractional pieceSquareValue => pieceSquareValue -> pieceSquareValue -> PieceSquareValueByNPieces pieceSquareValue
- formatForGNUPlot :: (pieceSquareValue -> ShowS) -> ShowS -> (PieceSquareValueByNPieces pieceSquareValue -> pieceSquareValue) -> PieceSquareByCoordinatesByRank pieceSquareValue -> ShowS
- mkPieceSquareByCoordinatesByRank :: (Rank -> EitherPieceSquareValueByNPiecesByCoordinates pieceSquareValue) -> PieceSquareByCoordinatesByRank pieceSquareValue
Types
Type-synonyms
Data-types
data PieceSquareByCoordinatesByRank pieceSquareValue Source #
The value for each type of piece of occupying each coordinate, at each stage in the lifetime of the game.
Instances
Eq pieceSquareValue => Eq (PieceSquareByCoordinatesByRank pieceSquareValue) Source # | |
Defined in BishBosh.Component.PieceSquareByCoordinatesByRank (==) :: PieceSquareByCoordinatesByRank pieceSquareValue -> PieceSquareByCoordinatesByRank pieceSquareValue -> Bool # (/=) :: PieceSquareByCoordinatesByRank pieceSquareValue -> PieceSquareByCoordinatesByRank pieceSquareValue -> Bool # | |
Show pieceSquareValue => Show (PieceSquareByCoordinatesByRank pieceSquareValue) Source # | |
Defined in BishBosh.Component.PieceSquareByCoordinatesByRank showsPrec :: Int -> PieceSquareByCoordinatesByRank pieceSquareValue -> ShowS # show :: PieceSquareByCoordinatesByRank pieceSquareValue -> String # showList :: [PieceSquareByCoordinatesByRank pieceSquareValue] -> ShowS # | |
NFData pieceSquareValue => NFData (PieceSquareByCoordinatesByRank pieceSquareValue) Source # | |
Defined in BishBosh.Component.PieceSquareByCoordinatesByRank rnf :: PieceSquareByCoordinatesByRank 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
:: PieceSquareByCoordinatesByRank pieceSquareValue | |
-> 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 #
:: 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.
:: (pieceSquareValue -> ShowS) | Format a pieceSquareValue. |
-> ShowS | The column-delimiter. |
-> (PieceSquareValueByNPieces pieceSquareValue -> pieceSquareValue) | Select one pieceSquareValue from interpolated values. |
-> PieceSquareByCoordinatesByRank pieceSquareValue | |
-> ShowS |
Format the data for input to GNUPlot.
Constructor
mkPieceSquareByCoordinatesByRank Source #
:: (Rank -> EitherPieceSquareValueByNPiecesByCoordinates pieceSquareValue) | Convert a rank into either (a pieceSquareValue or a pieceSquareValue which linearly varies with the number of pieces remaining) by coordinates. |
-> PieceSquareByCoordinatesByRank pieceSquareValue |
Constructor.