A Rust library for chess move generation
Generate legal moves:
```rust use shakmaty::Chess; use shakmaty::Position; use shakmaty::MoveList;
let pos = Chess::default(); // starting position
let mut legals = MoveList::new(); pos.legalmoves(&mut legals); asserteq!(legals.len(), 20); ```
Play moves:
```rust use shakmaty::Move; use shakmaty::Role; use shakmaty::square;
let pos = pos.play(&Move::Normal { role: Role::Pawn, from: square::E2, to: square::E4, capture: None, promotion: None, }).expect("1. e4 is legal"); ```
Detect game end conditions: pos.is_checkmate()
, pos.is_stalemate()
,
pos.is_insufficient_material()
, pos.outcome()
.
Read and write FENs, SANs and UCIs.
Supports Standard chess and these variants: Crazyhouse, King Of The Hill, Giveaway, ThreeCheck, Horde, Atomic, and RacingKings.
Bitboards and PDEP attack tables.
Shakmaty is licensed under the GPL-3.0 (or any later version at your option). See the COPYING file for the full license text.