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)
SourceClass methods
parse(fen : String)
Sourceparse_placement(placement)
Sourcestandard
SourceInstance methods
board
Sourceboard=(board : Board)
Sourcecastling
Sourcecastling=(castling : String)
Sourceen_passant
Sourceen_passant=(en_passant : String)
Sourcefullmove_counter
Sourcefullmove_counter=(fullmove_counter : Int16)
Sourcehalfmove_clock
Sourcehalfmove_clock=(halfmove_clock : Int8)
Sourceplacement
Sourceto_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.
turn
Sourceturn=(turn : String)
Sourceupdate(game : Game)
Source