| Crates.io | kish |
| lib.rs | kish |
| version | 1.1.6 |
| created_at | 2025-12-21 10:48:02.810555+00 |
| updated_at | 2026-01-06 14:21:27.1754+00 |
| description | A high-performance Turkish Draughts (Dama) engine with bitboard representation |
| homepage | |
| repository | https://github.com/Sanavesa/kish |
| max_upload_size | |
| id | 1997814 |
| size | 461,684 |
A high-performance Turkish Draughts (Dama) engine written in Rust.
Turkish Draughts (Dama) is a variant of checkers with orthogonal movement (horizontal and vertical) rather than diagonal. This engine implements all official rules and is optimized for speed using bitboard representation.
A B C D E F G H
8 . . . . . . . . 8 <- Black promotes here
7 b b b b b b b b 7
6 b b b b b b b b 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 w w w w w w w w 3
2 w w w w w w w w 2
1 . . . . . . . . 1 <- White promotes here
A B C D E F G H
Add to your Cargo.toml:
[dependencies]
kish = "1.0"
Or via cargo:
cargo add kish
use kish::{Game, GameStatus};
fn main() {
let mut game = Game::new();
// Game loop
while !game.status().is_over() {
let actions = game.actions();
// Pick a move (here: first legal move)
if let Some(action) = actions.first() {
game.make_move(action);
}
}
match game.status() {
GameStatus::Won(team) => println!("{} wins!", team),
GameStatus::Draw => println!("Draw!"),
_ => {}
}
}
The examples/ directory contains runnable examples:
basic_game.rs - Simple game loopcustom_position.rs - Setting up custom board positionsgame_with_history.rs - Using undo/redo and move historyperft.rs - Performance testing with perftRun an example with:
cargo run --example basic_game
| Type | Description |
|---|---|
Board |
Lightweight board state for AI/search |
Game |
Full game with history and draw detection |
Action |
Compact move (XOR delta representation) |
ActionPath |
Move with full path for notation |
Square |
Board square (A1-H8) |
Team |
White or Black |
GameStatus |
InProgress, Draw, or Won |
| Use Case | Type |
|---|---|
| AI search (alpha-beta, MCTS) | Board |
| Perft testing | Board |
| High-speed simulations | Board |
| Full games with draw detection | Game |
| Undo/redo support | Game |
use kish::{ActionPath, Square};
// Simple move: e3-e4
let mv = ActionPath::new_move(Square::E3, Square::E4, false);
// Capture: d4xd6
let cap = ActionPath::new_capture(Square::D4, &[Square::D6], false);
// Multi-capture: b3xd3xd5
let multi = ActionPath::new_capture(Square::B3, &[Square::D3, Square::D5], false);
// Promotion: c7-c8=K
let promo = ActionPath::new_move(Square::C7, Square::C8, true);
println!("{}", promo.to_notation()); // "c7-c8=K"
Benchmarks run on AMD Ryzen 9 3900X with RUSTFLAGS="-C target-cpu=native". See PERFORMANCE.md for the full optimization history.
| Depth | Nodes | Time | Nodes/sec |
|---|---|---|---|
| 5 | 85,090 | 228 µs | 373M |
| 6 | 931,312 | 2.7 ms | 341M |
| 7 | 10,782,382 | 32.5 ms | 332M |
| Position | Depth | Time |
|---|---|---|
| Initial (pawns) | 6 | 2.7 ms |
| King endgame (4v4) | 6 | 12.7 ms |
| Mixed midgame | 6 | 2.5 ms |
| Capture-heavy | 6 | 103 µs |
| King chains | 8 | 13.6 ms |
| Operation | Time |
|---|---|
| Generate moves (initial) | 37 ns |
| Generate moves (midgame) | 31 ns |
| Apply action | 2.2 ns |
| Board rotation | 2.0 ns |
| Check status | 37 ns |
Run benchmarks yourself:
RUSTFLAGS="-C target-cpu=native" cargo bench
See RULES.md for the complete official rules.
Python bindings are available via PyPI:
pip install kish
See kish-py/README.md for Python documentation and ML examples.
See CONTRIBUTING.md for development setup and release instructions.
Apache 2.0 - see LICENSE for details.