Chess Lab is a comprehensive chess library written in rust that supports multiple game variants along with FEN and PGN notations. It offers a straightforward API for seamless interaction with the game, enabling developers to integrate chess functionalities into their applications effortlessly. Additionally, it provides the capability to save and retrieve multiple game lines, facilitating the management of complex game scenarios.
use chess_lab::variants::StandardChess;
let mut game = StandardChess::default();
game.move_piece("e4").unwrap();
game.move_piece("e5").unwrap();
assert!(game.pgn().contains("1. e4 e5"));use chess_lab::core::VariantBuilder;
use chess_lab::variants::StandardChess;
let fen = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1";
let game = StandardChess::from_fen(fen).unwrap();
assert_eq!(game.fen(), fen);use chess_lab::variants::Chess960;
let game = Chess960::default();
let fen = game.fen();
assert!(fen.contains(" w KQkq - 0 1"));use chess_lab::core::VariantBuilder;
use chess_lab::variants::StandardChess;
let game = StandardChess::load("data/standard/ex1.pgn").unwrap();
assert!(game.pgn().contains("1. e4"));Add the following dependency to your Cargo.toml file:
[dependencies]
chess-lab = "0.2.1"https://deepwiki.com/Santicm23/chess-lab
- Playable Chess game
- FEN/PGN support
- Multiple game lines
- Multiple variants
- Chess engine
- Standard Chess
- Position-Based Chess
- Chess960
- Three-Check
- Antichess
- Horde
- Duck Chess
- Racing Kings
- King of the Hill
- Crazyhouse
- Atomic