Metadata-Version: 2.4
Name: dame-rs
Version: 0.2.0
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Classifier: Programming Language :: Python :: Free Threading :: 3 - Stable
Classifier: Programming Language :: Rust
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Games/Entertainment :: Board Games
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Typing :: Typed
License-File: LICENSE
Summary: An extremely fast international draughts engine for Python, written in Rust 🦀.
Keywords: draughts,checkers,engine,game,bitboard
Home-Page: https://github.com/KarelZe/dame-rs
Author-email: Markus Bilz <github@markusbilz.com>
License-Expression: MIT
Requires-Python: >=3.10
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Bug Tracker, https://github.com/KarelZe/dame-rs/issues
Project-URL: Documentation, https://KarelZe.github.io/dame-rs/
Project-URL: Homepage, https://github.com/KarelZe/dame-rs

# dame-rs

`dame`[^name] is an extremely fast [international draughts](https://en.wikipedia.org/wiki/International_draughts)
(10x10 checkers) engine written in Rust 🦀, with a pythonic API.

[^name]: *Dame* is German for draughts (checkers), and also for a king in the game: a
piece that reaches the far row is crowned a *Dame*.

## Installation

```bash
uv add dame-rs
```

or if you prefer slow:

```bash
pip install dame-rs
```

## Usage

```python
import dame

board = dame.Board()  # or dame.Board("W:W31-50:B1-20")
board.legal_moves  # [Move('31-26'), Move('32-27'), ...]
board.push("32-28")
board.push("19-23")
board.legal_moves  # [Move('28x19x23')]: capturing is mandatory

engine = dame.Engine(hash_mb=64)
result = engine.search(board, time=1.0)
result.best_move, result.score, result.depth  # (Move('28x19x23'), 2, 13)
board.push(result.best_move)
print(board)
```

The search runs without the GIL and reports progress through an optional
`info` callback. See the [API Reference](https://KarelZe.github.io/dame-rs/api/).

## Playing

Play against the engine in the terminal, or plug it into any GUI that speaks
the [Hub protocol](https://github.com/rhalbersma/scan/blob/master/protocol.txt):

```bash
uv tool install dame-rs               # the `dame` command; or: cargo install --path crates/dame-cli
dame play --time 2
dame hub
DAME_BOOK=games.pdn dame play         # open games from a PDN game collection
```

On macOS, `Dame.app` is a native board that plays against the engine. Download
the `.dmg` from the [latest release](https://github.com/KarelZe/dame-rs/releases/latest)
or build it with `scripts/bundle-macos.sh` (see [macOS app](https://KarelZe.github.io/dame-rs/macos/)).

<p align="center">
  <img src="https://raw.githubusercontent.com/KarelZe/dame-rs/main/docs/assets/macos-app.png" alt="Dame.app, a native macOS board, in the middle of a game, with the engine's expected line, depth and score in the status bar" width="480">
</p>

See [Command line](https://KarelZe.github.io/dame-rs/cli/) for details and
[Engine design](https://KarelZe.github.io/dame-rs/design/) for how the engine works.

## Development

```bash
uv sync                               # build the extension and install dev tools
cargo test --release                  # Rust tests
uv run pytest                         # Python tests
uv run prek run --all-files           # linters and formatters
```

See [AGENTS.md](AGENTS.md) for the full workflow.

> [!WARNING]
> 🧪 **Experimental.** `dame` is in early development and was built just for fun
> with [Claude Code](https://github.com/anthropics/claude-code). The API will change.

## License

`dame` is licensed under the [MIT license](LICENSE).

## Contact

To get in contact, please open an issue or contact me via `github@markusbilz.com`.

