class

LxChess::Fen

Inherits Reference < Object

Forsyth-Edwards Notation parser and converter

Constants

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

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

Class methods

parse(fen : String)
Source
parse_placement(placement)
Source
standard
Source

Instance methods

board
Source
board=(board : Board)
Source
castling
Source
castling=(castling : String)
Source
en_passant
Source
en_passant=(en_passant : String)
Source
fullmove_counter
Source
fullmove_counter=(fullmove_counter : Int16)
Source
halfmove_clock
Source
halfmove_clock=(halfmove_clock : Int8)
Source
placement
Source
to_s

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.

Source
turn
Source
turn=(turn : String)
Source
update(game : Game)
Source

Nested types