♔♕♖♗♘♙ crabchess
crabchess
is a 100% Rust Chess API with no unsafe
code that enables you to build
chess-related software tools. crabchess
can import and export PGNs (Portable Game
Notation) and FENs (Forsyth-Edwards Notation), determine the status of a game of chess,
identify illegal move attempts, determine a game's ECO opening, track players' time
remaining, and much more. crabchess
works not only with standard chess but also random
board configurations like Fischer random chess (Chess960).
Documentation
The full documentation is available at docs.rs.
Example
Most of the core functionality is exposed through the ChessPosition
struct, which
represents a game of chess. The ChessPosition
struct can be mutated and consulted as
a game progresses.
use *;
// Create board with default (Staunton) starting position.
let mut position = new;
// Apply moves in SAN format.
position
.apply_sans
.unwrap;
// Or, use the `Move` enum.
position
.apply_move
.unwrap;
assert_eq!;
position
.apply_move
.unwrap;
License
This project is licensed under the MIT License - see the LICENSE file for details.