| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
BishBosh.Attribute.RankValues
Description
AUTHOR- Dr. Alistair Ward
DESCRIPTION
- The relative values of the various ranks of chess-piece.
- Chess-piece relative values
- data RankValues rankValue
- tag :: String
- findRankValue :: Rank -> RankValues rankValue -> rankValue
- calculateMaximumTotalValue :: Num rankValue => RankValues rankValue -> rankValue
- fromAssocs :: (Fractional rankValue, Ord rankValue, Show rankValue) => [(Rank, rankValue)] -> RankValues rankValue
Types
Data-types
data RankValues rankValue Source #
- The constant value associated with each rank; the higher, the more valuable it is considered to be.
- N.B.: only relative values are significant; the absolute value associated with any rank is irrelevant, but typically
Pawn = 1. - CAVEAT: a
Kingcan never be taken, but assigning the value infinity creates problems, so typically it has the value0.
Instances
| Eq rankValue => Eq (RankValues rankValue) Source # | |
| Read rankValue => Read (RankValues rankValue) Source # | |
| Show rankValue => Show (RankValues rankValue) Source # | |
| NFData rankValue => NFData (RankValues rankValue) Source # | |
| (Fractional rankValue, Ord rankValue, Show rankValue) => Default (RankValues rankValue) Source # | |
| (Fractional rankValue, XmlPickler rankValue, Ord rankValue, Show rankValue) => XmlPickler (RankValues rankValue) Source # | |
| Real rankValue => ShowFloat (RankValues rankValue) Source # | |
Constants
Functions
findRankValue :: Rank -> RankValues rankValue -> rankValue Source #
Query.
calculateMaximumTotalValue :: Num rankValue => RankValues rankValue -> rankValue Source #
- The maximum total rank-value one side can have.
- CAVEAT: assumes that zero pieces have been captured, all
Pawns have been queened, & that this is the most valuable rank of piece.
Constructor
fromAssocs :: (Fractional rankValue, Ord rankValue, Show rankValue) => [(Rank, rankValue)] -> RankValues rankValue Source #
Smart-constructor.