Echecs.Piece (Echecs v0.1.5)

Copy Markdown View Source

Piece colors (:white, :black) and types (:pawn, :knight, :bishop, :rook, :queen, :king).

A piece is a {color, type} tuple. Helpers cover side switching (opponent/1) and FEN-character conversion (from_char/1, to_char/1, type_from_char/1, color_from_char/1).

Summary

Types

color()

@type color() :: :white | :black

t()

@type t() :: {color(), type()}

type()

@type type() :: :pawn | :knight | :bishop | :rook | :queen | :king

Functions

color_from_char(char)

colors()

from_char(char)

opponent(atom)

to_char(arg)

type_from_char(char)

types()