shakmaty
A Rust library for chess move generation
Features
-
Generate legal moves:
use ; let pos = default; let legals = pos.legals; assert_eq!;
-
Play moves:
use ; // 1. e4 let pos = pos.play?;
-
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 Chess960. Provides vocabulary to implement other variants.
-
Bitboards and compact fixed shift magic attack tables.
Documentation
Changelog
- 0.4.2
- Fix build error on beta due to the new nightly
option_filter
feature. - Fix unterminated code block in documentation.
- Fix build error on beta due to the new nightly
- 0.4.1
- Fix build error due to the new nightly
option_filter
feature.
- Fix build error due to the new nightly
- 0.4.0
- Rename
Color::from_bool()
toColor::from_white()
, addColor::from_black()
. - Add
Move::role()
,Move::is_en_passant()
andMove::is_castle()
. - Add
Position::en_passant_moves()
andPosition::capture_moves()
. - Implement
BitXor<bool>
forColor
. - Implement
FusedIterator
andTrustedLen
onBitboard
.
- Rename
- 0.3.0
- Switch to
#[repr(i8)]
forSquare
. Implement all lossless integer conversionsFrom<Square>
. - Add
Square::flip_horizontal()
,flip_vertical()
andflip_diagonal()
. - Efficiently implement
CarryRippler::last()
by @nvzqz. - Eliminate some unchecked indexing by @nvzqz.
- Faster ASCII case conversions and tests by @nvzqz.
- Switch to
- 0.2.0
Square
is now a#[repr(u8)]
enum.- Use
bitflags
forPositionError
. - Rename
RemainingChecks::subtract()
todecrement()
. - Add
Position::swap_turn()
.
- 0.1.0
- First release with support for stable Rust.
License
Shakmaty is licensed under the GPL-3.0 (or any later version at your option). See the COPYING file for the full license text.