| Crates.io | rchess |
| lib.rs | rchess |
| version | 2.3.0 |
| created_at | 2024-08-24 19:47:20.670162+00 |
| updated_at | 2025-01-16 18:39:36.415505+00 |
| description | A Chess Library Written In Rust |
| homepage | |
| repository | https://github.com/Shadowcat650/rchess |
| max_upload_size | |
| id | 1350523 |
| size | 224,740 |
A Chess Library Written in Rust
rchess is a Rust-based library designed for applications that need to work with chess games or boards, such as UCI GUIs or online chess platforms.
If you encounter any bugs, have suggestions for improving code readability or performance, or would like to contribute, we encourage you to create a pull request. For significant API changes or feature requests, please open an issue on GitHub.
Documentation for rchess can be found here.
Add the following to your Cargo.toml:
[dependencies]
rchess = "2.3.0"
use rchess::ChessGame;
fn main() {
// Create a new chess game.
let mut game = ChessGame::new();
// Get the legal moves for the current position.
let moves = game.moves();
// Make a move.
game.make_move(moves[0]);
}
By default, no features are enabled.
To use magic bitboards for sliding piece move generation, enable the magic-table feature. On my device, this feature speeds up the benches by around 18%.
Build times will be faster without the magic-table feature enabled.
Use the serde feature to enable serialization and deserialization.
To improve the slow build time when the magic-table is enabled, set your build override opt-level to 3.
[profile.dev.build-override]
opt-level = 3
[profile.test.build-override]
opt-level = 3
[profile.release.build-override]
opt-level = 3
We welcome contributions! Please adhere to the following guidelines:
This project is dual-licensed under the MIT and APACHE 2.0 licenses.