diff --git a/src/lx_chess.cr b/src/lx_chess.cr index 4747fb8..c5cb6d9 100644 --- a/src/lx_chess.cr +++ b/src/lx_chess.cr @@ -24,6 +24,11 @@ OptionParser.parse do |parser| exit end + parser.on("-v", "--version", "show version information") do + puts "lx_chess version #{LxChess::VERSION}" + exit + end + parser.invalid_option do |flag| STDERR.puts "ERROR: #{flag} is not a valid option." STDERR.puts parser diff --git a/src/lx_chess/board.cr b/src/lx_chess/board.cr index 86a9bc1..09acc6b 100644 --- a/src/lx_chess/board.cr +++ b/src/lx_chess/board.cr @@ -1,6 +1,8 @@ require "./piece" module LxChess + # A *Board* represents the squares of a chess board. it also handles coversion of + # indicies <=> cords. The internal representation is a contiguous array class Board include Enumerable(Piece | Nil) diff --git a/src/lx_chess/fen.cr b/src/lx_chess/fen.cr index 65c734a..8b316af 100644 --- a/src/lx_chess/fen.cr +++ b/src/lx_chess/fen.cr @@ -3,6 +3,7 @@ require "./piece" require "./error" module LxChess + # Forsyth-Edwards Notation parser and converter class Fen class InvalidFen < Error; end diff --git a/src/lx_chess/game.cr b/src/lx_chess/game.cr index 64649a1..ee05b68 100644 --- a/src/lx_chess/game.cr +++ b/src/lx_chess/game.cr @@ -5,6 +5,7 @@ require "./move_set" require "./error" module LxChess + # Represents a standard game of Chess class Game class SanError < Error; end diff --git a/src/lx_chess/notation.cr b/src/lx_chess/notation.cr index c34462d..fd18824 100644 --- a/src/lx_chess/notation.cr +++ b/src/lx_chess/notation.cr @@ -3,6 +3,8 @@ require "./piece" require "./board" module LxChess + # Parses Standard Algebraic Notation + # ex: `Pbxc8=Q` pawn on the b file takes c8 and promotes to Queen class Notation class InvalidNotation < Error; end