class LxChess::PGN

Defined in:

lx_chess/pgn.cr

Constant Summary

COMMENT_REGEX = /\s*\{[^\}]+\}\s*/i
SAN_REGEX = /\ ([A-Z])? # piece ([a-z])?(\d)? # disambiguation x? # takes ([a-z]\d|O-O(?:-O)?) # destination (\=\s*[A-Z])? # promotion ([\+\#])? # check\/checkmate (\s*e\.?\s*p\.?)? # en passant /x
TAG_REGEX = /\[(?<key>[a-z]+)\s+(?<value>[^\]]+)\]/i
TURN_REGEX = /\d+\.+\s*/
VARIATION_REGEX = /\s*\([^\)]+\)\s*/i

Constructors

Instance Method Summary

Constructor Detail

def self.new(pgn : String) #

[View source]
def self.new(game : LxChess::Game = Game.new) #

[View source]

Instance Method Detail

def changes : Array(Array(LxChess::Change)) #

[View source]
def changes=(changes : Array(Array(LxChess::Change))) #

[View source]
def game : Game #

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

[View source]
def history : Array(LxChess::Notation) #

[View source]
def history=(history : Array(LxChess::Notation)) #

[View source]
def strings #

[View source]
def tags : Hash(String, String) #

[View source]
def tags=(tags : Hash(String, String)) #

[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]