class LxChess::Game
- LxChess::Game
- Reference
- Object
Overview
Represents a standard game of Chess
Defined in:
lx_chess/game.crConstructors
Instance Method Summary
- #board : Board
- #board=(board : Board)
- #can_castle_king?(piece)
- #can_castle_queen?(piece)
- #castling
- #castling=(string : String)
-
#checkmate?(turn = @turn)
TODO Optimize Make every move and test for check, if any move results in check=false, stop checking and return false
- #current_player
-
#disambiguate_candidates(notation : Notation, move_sets : Array(MoveSet))
Attempt to reduce ambiguities in candidate moves
- #en_passant_target : Int16 | Nil
- #en_passant_target=(en_passant_target : Int16 | Nil)
- #en_passant_target=(cord : String)
- #fifty_move_rule : Int8
- #fifty_move_rule=(fifty_move_rule : Int8)
-
#find_king(turn = @turn)
Find the king, optionally specifying turn
- #full_moves
- #in_check?(turn = @turn)
- #make_move(from : String, to : String, promotion : Char | Nil = nil)
-
#make_move(from : Int16, to : Int16, promotion : Char | Nil = nil)
Make a move given a set of coordinates
- #move_clock : Int16
- #move_clock=(move_clock : Int16)
- #move_to_san(from : String, to : String, promotion : Char | Nil = nil, turn = @turn)
- #move_to_san(from : Int, to : Int, promotion : Char | Nil = nil, turn = @turn)
-
#moves(square : String | Int)
Generate the psuedo-legal moves for a given square
-
#next_turn(turn = @turn)
Get the next turn index
-
#next_turn!
Increment the turn index
-
#parse_san(notation : String)
Parse SAN from a string
-
#parse_san(notation : Notation)
Parse standard algebraic notation
-
#pieces_for(turn = @turn)
Return the pieces for a specified player
- #players : Array(Player)
-
#remove_illegal_moves(move_set : MoveSet)
Removes moves that reveal check from a MoveSet TODO: optimize this? Maybe don't generate illegal moves and stop early for sliding pieces
- #set_fen_attributes(fen : Fen)
- #tmp_move(from : String, to : String, promotion : Char | Nil = nil, &)
-
#tmp_move(from : Int16, to : Int16, promotion : Char | Nil = nil, &)
Temporarily make a move
- #turn : Int8
- #turn=(turn : Int8)
-
#undo(changes : Array(Change))
Undo a move
Constructor Detail
Instance Method Detail
TODO Optimize Make every move and test for check, if any move results in check=false, stop checking and return false
Attempt to reduce ambiguities in candidate moves
Make a move given a set of coordinates
Removes moves that reveal check from a MoveSet
TODO optimize this? Maybe don't generate illegal moves and stop early for sliding pieces