chess_logic v0.3.0 ChessLogic.Position
Documentation for Position.
Link to this section Summary
Functions
Returns all possible moves from a position.
Returns all possible moves from a given piece, or square.
Returns a position from a fen string.
Check if king is attacked.
Returns a san from a move string, given a set of possible moves. Game history persists a san version of move, for PGN export eg. "e2e4" -> "e4", "e4" -> "e4"
Plays a move and returns new position.
Prints a position.
Returns a coords move (eg. "e2e4") from san (eg. "e4")
Returns position status.
Returns a fen string from a position.
Link to this section Functions
all_possible_moves(position)
Returns all possible moves from a position.
all_possible_moves_from(position, start_piece)
Returns all possible moves from a given piece, or square.
from_fen(fen \\ "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1")
Returns a position from a fen string.
is_king_attacked(position)
Check if king is attacked.
move_to_san(position, move)
Returns a san from a move string, given a set of possible moves. Game history persists a san version of move, for PGN export eg. "e2e4" -> "e4", "e4" -> "e4"
play(position, move)
Plays a move and returns new position.
print(position)
Prints a position.
san_to_move(position, san)
Returns a coords move (eg. "e2e4") from san (eg. "e4")
status(position)
Returns position status.
to_fen(position)
Returns a fen string from a position.