class LxChess::Fen

Overview

Forsyth-Edwards Notation parser and converter

Defined in:

lx_chess/fen.cr

Constant Summary

FEN_REGEX = /\ (?<placement>(?:[PKQRBN\d\/]+)+)\s+ (?<turn>[a-z])\s+ (?<castling>[a-z\-]+)\s+ (?<en_passant>[a-z\d\-]+)\s+ (?<half_clock>\d+)\s+ (?<full_clock>\d+) /ix
STANDARD = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(board : LxChess::Board, turn : String = "w", castling : String = "KQkq", en_passant : String = "-", halfmove_clock : Int8 = 0, fullmove_counter : Int16 = 1) #

[View source]

Class Method Detail

def self.parse(fen : String) #

[View source]
def self.parse_placement(placement) #

[View source]
def self.standard #

[View source]

Instance Method Detail

def board : Board #

[View source]
def board=(board : Board) #

[View source]
def castling : String #

[View source]
def castling=(castling : String) #

[View source]
def en_passant : String #

[View source]
def en_passant=(en_passant : String) #

[View source]
def fullmove_counter : Int16 #

[View source]
def fullmove_counter=(fullmove_counter : Int16) #

[View source]
def halfmove_clock : Int8 #

[View source]
def halfmove_clock=(halfmove_clock : Int8) #

[View source]
def placement #

[View source]
def to_s #
Description copied from class Object

Returns a nicely readable and concise string representation of this object, typically intended for users.

This method should usually not be overridden. It delegates to #to_s(IO) which can be overridden for custom implementations.

Also see #inspect.


[View source]
def turn : String #

[View source]
def turn=(turn : String) #

[View source]
def update(game : Game) #

[View source]