Maintainer | hapytexeu+gh@gmail.com |
---|---|
Stability | experimental |
Portability | POSIX |
Safe Haskell | Safe |
Language | Haskell2010 |
One can make use of a block 2600 and block 1fa00 of Unicode characters to render chess characters. One can render chess characters as netral, white, or black pieces, for such pieces one can render these rotated by 0, 90, 180 and 270 degrees. Knights can be rendered on 45, 135, 225 and 315 degrees as well. Furthermore unicode allows to render an equihopper, and special variants like a knight-queen, knight-rook, and knight-bishop.
The module contains pattern synonyms for names that are often given to the pieces.
Synopsis
- data ChessColor
- data ChessColorBinary
- data ChessPieceType
- data ChessHybridType
- data ChessPiece
- data Rotate45
- chessPiece :: ChessPiece -> Char
- pattern Grasshopper :: ChessColor -> ChessPiece
- pattern Nightrider :: ChessColor -> ChessPiece
- pattern Amazon :: ChessColorBinary -> ChessPiece
- pattern Terror :: ChessColorBinary -> ChessPiece
- pattern OmnipotentQueen :: ChessColorBinary -> ChessPiece
- pattern Superqueen :: ChessColorBinary -> ChessPiece
- pattern Chancellor :: ChessColorBinary -> ChessPiece
- pattern Marshall :: ChessColorBinary -> ChessPiece
- pattern Empress :: ChessColorBinary -> ChessPiece
- pattern Cardinal :: ChessColorBinary -> ChessPiece
- pattern Princess :: ChessColorBinary -> ChessPiece
Data structures to represent the possible chess pieces.
data ChessColor Source #
White | White color. |
Black | Black color. |
Neutral | Neutral chess pieces, sometimes depicted half white and half black. |
Instances
data ChessColorBinary Source #
A data type that defined binary colors (BWhite
, and BBlack
), this is
used for special chess pieces like a knight queen, knight rook, and
knight bishop that only have no neutral color in unicode.
Instances
data ChessPieceType Source #
The type of chess pieces. Unicode includes an Equihopper
as piece as
well.
King | The king chess piece. |
Queen | The queen chess piece. |
Rook | The rook chess piece. |
Bishop | The bishop chess piece. |
Knight | The knight chess piece. |
Pawn | The pawn chess piece. |
Equihopper | The equihopper chess piece. |
Instances
data ChessHybridType Source #
Hybrid chess pieces like the knight-queen, knight-rook and knight-bishop.
KnightQueen | The knight-queen chess piece. |
KnightRook | The knight-rook chess piece. |
KnightBishop | The knight-bishop chess piece. |
Instances
data ChessPiece Source #
Chess pieces that can be represented in Unicode. These are the king,
queen, rook, bishop, knight, pawn, and equihopper over 0, 90,
180, and 270 degrees; and the knight over 45, 135, 225, and 315
degrees in Black
, White
and Neutral
.
Furthermore one can draw a knight-queen, knight-rook, and knight-bishop
pieces can be drawn without rotation and only in BBlack
or BWhite
.
Chess90 ChessColor ChessPieceType Rotate90 | Standard pieces drawn in black, white, or neutral and with rotation. |
Chess45Knight ChessColor Rotate45 | Knights have unicode characters to render these rotated over 45, 135, 225 and 315 degrees. |
ChessHybrid ChessHybridType ChessColorBinary | Hybrid chess pieces can only be rendered in |
Instances
Eq ChessPiece Source # | |
Defined in Data.Char.Chess (==) :: ChessPiece -> ChessPiece -> Bool # (/=) :: ChessPiece -> ChessPiece -> Bool # | |
Ord ChessPiece Source # | |
Defined in Data.Char.Chess compare :: ChessPiece -> ChessPiece -> Ordering # (<) :: ChessPiece -> ChessPiece -> Bool # (<=) :: ChessPiece -> ChessPiece -> Bool # (>) :: ChessPiece -> ChessPiece -> Bool # (>=) :: ChessPiece -> ChessPiece -> Bool # max :: ChessPiece -> ChessPiece -> ChessPiece # min :: ChessPiece -> ChessPiece -> ChessPiece # | |
Read ChessPiece Source # | |
Defined in Data.Char.Chess readsPrec :: Int -> ReadS ChessPiece # readList :: ReadS [ChessPiece] # readPrec :: ReadPrec ChessPiece # readListPrec :: ReadPrec [ChessPiece] # | |
Show ChessPiece Source # | |
Defined in Data.Char.Chess showsPrec :: Int -> ChessPiece -> ShowS # show :: ChessPiece -> String # showList :: [ChessPiece] -> ShowS # | |
Arbitrary ChessPiece Source # | |
Defined in Data.Char.Chess arbitrary :: Gen ChessPiece # shrink :: ChessPiece -> [ChessPiece] # |
Extra rotations that can be performed for knight chess pieces.
R45 | Rotation over 45 degrees. |
R135 | Rotation over 135 degrees. |
R225 | Rotation over 225 degrees. |
R315 | Rotation over 315 degrees. |
Instances
Bounded Rotate45 Source # | |
Enum Rotate45 Source # | |
Eq Rotate45 Source # | |
Ord Rotate45 Source # | |
Defined in Data.Char.Chess | |
Read Rotate45 Source # | |
Show Rotate45 Source # | |
Arbitrary Rotate45 Source # | |
Convert the chess piece to its unicode equivalent.
:: ChessPiece | The given |
-> Char | The unicode character that represents the given |
Convert the given ChessPiece
to the corresponding unicode character.
Pattern synonyms of special pieces
pattern Grasshopper :: ChessColor -> ChessPiece Source #
A grasshopper is a queen rotated over 180 degrees.
pattern Nightrider :: ChessColor -> ChessPiece Source #
A Nightrider is a knight rotated over 180 degrees.
pattern Amazon :: ChessColorBinary -> ChessPiece Source #
An amazon is alterative name for a knight-queen.
pattern Terror :: ChessColorBinary -> ChessPiece Source #
A terror is alterative name for a knight-queen.
pattern OmnipotentQueen :: ChessColorBinary -> ChessPiece Source #
An omnipotent queen is alterative name for a knight-queen.
pattern Superqueen :: ChessColorBinary -> ChessPiece Source #
A superqueen is alterative name for a knight-queen.
pattern Chancellor :: ChessColorBinary -> ChessPiece Source #
A chancellor is alterative name for a knight-rook.
pattern Marshall :: ChessColorBinary -> ChessPiece Source #
A marshall is alterative name for a knight-rook.
pattern Empress :: ChessColorBinary -> ChessPiece Source #
An empress is alterative name for a knight-rook.
pattern Cardinal :: ChessColorBinary -> ChessPiece Source #
A cardinal is alterative name for a knight-bishop.
pattern Princess :: ChessColorBinary -> ChessPiece Source #
A princess is alterative name for a knight-bishop.