Chess Library
This is a chess library that does the management of chess games. It calculates all legal moves for any given position, and handles all events that might happen during a chess game
Start a game
This starts a new game session and returns a game struct
const game = Start;
Game struct
This struct holds all important information about the current game
Status
This struct contain all important information about the current game status
Get Moves
The first function gets all the legal moves for all pieces and maps all legal moves for each piece to its corresponding position on the board
The second function gets all legal moves for any given position (rank, file)
use HashMap;
const all_legal_moves: = get_all_legal_moves;
const legal_moves = = get_legal_moves_for_piece;
Make move
This function makes a move and modifies the game struct and returns a boolean on whether the operation was successful or not
let mut game = new;
match make_move
}