unicode-tricks-0.6.0.0: Functions to work with unicode blocks more convenient.

Maintainerhapytexeu+gh@gmail.com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellSafe
LanguageHaskell2010

Data.Char.Chess

Contents

Description

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 structures to represent the possible chess pieces.

data ChessColor Source #

The color of a chess piece, this can for most pieces be Black, White, or Neutral.

Constructors

White

White color.

Black

Black color.

Neutral

Neutral chess pieces, sometimes depicted half white and half black.

Instances
Bounded ChessColor Source # 
Instance details

Defined in Data.Char.Chess

Enum ChessColor Source # 
Instance details

Defined in Data.Char.Chess

Eq ChessColor Source # 
Instance details

Defined in Data.Char.Chess

Ord ChessColor Source # 
Instance details

Defined in Data.Char.Chess

Read ChessColor Source # 
Instance details

Defined in Data.Char.Chess

Show ChessColor Source # 
Instance details

Defined in Data.Char.Chess

Arbitrary ChessColor Source # 
Instance details

Defined in Data.Char.Chess

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.

Constructors

BWhite

White color.

BBlack

Black color.

Instances
Bounded ChessColorBinary Source # 
Instance details

Defined in Data.Char.Chess

Enum ChessColorBinary Source # 
Instance details

Defined in Data.Char.Chess

Eq ChessColorBinary Source # 
Instance details

Defined in Data.Char.Chess

Ord ChessColorBinary Source # 
Instance details

Defined in Data.Char.Chess

Read ChessColorBinary Source # 
Instance details

Defined in Data.Char.Chess

Show ChessColorBinary Source # 
Instance details

Defined in Data.Char.Chess

Arbitrary ChessColorBinary Source # 
Instance details

Defined in Data.Char.Chess

data ChessPieceType Source #

The type of chess pieces. Unicode includes an Equihopper as piece as well.

Constructors

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
Bounded ChessPieceType Source # 
Instance details

Defined in Data.Char.Chess

Enum ChessPieceType Source # 
Instance details

Defined in Data.Char.Chess

Eq ChessPieceType Source # 
Instance details

Defined in Data.Char.Chess

Ord ChessPieceType Source # 
Instance details

Defined in Data.Char.Chess

Read ChessPieceType Source # 
Instance details

Defined in Data.Char.Chess

Show ChessPieceType Source # 
Instance details

Defined in Data.Char.Chess

Arbitrary ChessPieceType Source # 
Instance details

Defined in Data.Char.Chess

data ChessHybridType Source #

Hybrid chess pieces like the knight-queen, knight-rook and knight-bishop.

Constructors

KnightQueen

The knight-queen chess piece.

KnightRook

The knight-rook chess piece.

KnightBishop

The knight-bishop chess piece.

Instances
Bounded ChessHybridType Source # 
Instance details

Defined in Data.Char.Chess

Enum ChessHybridType Source # 
Instance details

Defined in Data.Char.Chess

Eq ChessHybridType Source # 
Instance details

Defined in Data.Char.Chess

Ord ChessHybridType Source # 
Instance details

Defined in Data.Char.Chess

Read ChessHybridType Source # 
Instance details

Defined in Data.Char.Chess

Show ChessHybridType Source # 
Instance details

Defined in Data.Char.Chess

Arbitrary ChessHybridType Source # 
Instance details

Defined in Data.Char.Chess

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.

Constructors

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 BBlack and BWhite.

data Rotate45 Source #

Extra rotations that can be performed for knight chess pieces.

Constructors

R45

Rotation over 45 degrees.

R135

Rotation over 135 degrees.

R225

Rotation over 225 degrees.

R315

Rotation over 315 degrees.

Instances
Bounded Rotate45 Source # 
Instance details

Defined in Data.Char.Chess

Enum Rotate45 Source # 
Instance details

Defined in Data.Char.Chess

Eq Rotate45 Source # 
Instance details

Defined in Data.Char.Chess

Ord Rotate45 Source # 
Instance details

Defined in Data.Char.Chess

Read Rotate45 Source # 
Instance details

Defined in Data.Char.Chess

Show Rotate45 Source # 
Instance details

Defined in Data.Char.Chess

Arbitrary Rotate45 Source # 
Instance details

Defined in Data.Char.Chess

Convert the chess piece to its unicode equivalent.

chessPiece Source #

Arguments

:: ChessPiece

The given ChessPiece to convert.

-> Char

The unicode character that represents the given ChessPiece.

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.