# Crownroom computer engine

Russian and Brazilian computer play uses an adaptation of **Damka** by Anton Medvedev.

- Upstream: https://github.com/antonmedv/damka
- Pinned revision: `ed824bfbff291ae35d328a0b95a9a98236135ca4`
- Copyright (c) 2026 Anton Medvedev. Distributed under the MIT license in `LICENSE.txt`.
- The browser modules in this folder are readable JavaScript compiled from the adapted TypeScript sources.

Damka supplies the bitboard move generator, evaluation, iterative deepening alpha-beta/PVS search, transposition table, move ordering, and capture search.

Crownroom modifications:

1. Added Brazilian rules: maximum total captures, no promotion during a capture chain, and promotion only when the completed turn ends on the last rank. Rules apply throughout the search, and transposition entries distinguish the variants.
2. Explore every legal flying-king landing and continue capturing from the chosen landing when possible.
3. Added board-coordinate conversion, validation against Crownroom's rules, and recovery for saved games partway through a capture.
4. Run searches in a cancellable Web Worker, normally up to 18 plies with an 800 ms budget. Device speed and the position affect achieved depth. No Elo claim is made.

Upstream endgame-table loading is not enabled. Original engine-generated starter opening data is bundled separately in ../../books/ under MIT. No external opening book or endgame data is downloaded. American checkers retains the Crownroom practice engine.

The MIT license allows reuse and modification with the copyright and permission notice retained. The full license is provided alongside this notice.
