Formal Specification
Nine Men's Morris — Formal Specification
Bulgaria · board-abstract · Confidence: medium
← Back to game pageImplementation Suitability
Suitability: engine-readyFidelity: directGap-fills: 2
# Damka — AI-optimized specification
## General idea
A fully deterministic, perfect-information two-player alignment board game played on a 24-node graph of three concentric squares. Players progress through three distinct tactical phases: piece placement, adjacent graph-edge movement, and an asymmetric "flying" endgame phase for any player reduced to three pieces. Aligning three pieces along a defined mill line triggers the capture of an opponent piece.
## Formal model
- **Abstraction taken:** None (`fidelity_class: direct`). The game rules form a complete discrete combinatorial system.
- **Player/agent count:** 2 players ().
- **Turn model:** Strictly sequential, alternating single actions per turn.
## Formal rules
R1. Board Graph: Defined as graph where intersection nodes. Nodes are indexed . The edge set contains 32 undirected edges forming 16 distinct collinear 3-node sets (mills/damkas): , where each .
R2. Piece allocation: Each player possesses 9 pieces (). Board state begins with all nodes empty: .
R3. Phase 1 — Placement:
- On turn , active player places 1 piece from hand onto any node where .
- If placement forms a new mill with 3 pieces of active player's color, active player must execute action `capture_piece(u)`.
- Sanctuary rule: Node must belong to opponent and must NOT be part of an active opponent mill, unless all opponent pieces on board are in mills.
R4. Phase 2 — Movement:
- Begins when all 18 pieces are placed from hand.
- Active player selects node with their piece and moves it to adjacent node where .
- If move completes a mill, player executes `capture_piece(target)` per R3 sanctuary rule.
R5. Phase 3 — Flying (Jump movement):
- For any player whose total remaining pieces on board , is in "flying" state:
- On their turn, may move a piece from any occupied node to *any* empty node (not restricted to ).
R6. Win / Loss conditions:
- Player loses immediately if at any time.
- Player loses immediately if at the start of their turn they have 0 legal moves available (complete immobilization).
R7. [gap-fill] Draw / Loop-breaking condition:
- If the exact same board position (node assignments, hand counts, active player) occurs three times (threefold repetition), the game ends immediately in a draw.
- [gap-fill] If 50 consecutive moves occur without a mill or capture, the game ends in a draw (fifty-move rule).
## Edge cases
- Tie at the end condition: Achieved only via R7 draw conditions (threefold repetition or 50 moves without capture).
- A player with no legal move: Handled explicitly in R6 — having no legal moves constitutes an immediate loss for the immobilized player.
- Repetition / cycles: Explicitly bounded by R7 threefold repetition and 50-move draw rules.
- Simultaneous claims on the same resource or position: Not applicable — turns are strictly sequential; exactly one node is occupied/vacated per action.
- Player elimination mid-round; turn order repair: 2-player game — elimination of one player immediately terminates the game with the surviving player declared winner.
- Resource exhaustion: Pieces are finite (9 per player); captures permanently remove pieces from the board until win condition R6 is met.
- Termination guarantee: Enforced by the finite board state space combined with R7 repetition and move-count draw limits.
## State representation
- Persistent state: Node occupancy array , pieces in hand , active player , move counter without capture, position history hash map.
- Per-turn ephemeral state: Mill-formed flag, pending capture requirement.
- Observable information: Fully observable, zero hidden information.
## Action space
- `place_piece(node_id)`: Precondition: Phase == Placement, , .
- `move_piece(from_node, to_node)`: Precondition: Phase == Movement, , , and .
- `capture_piece(target_node)`: Precondition: Mill completed this turn, , sanctuary check satisfied.
## Playability notes
- Single-player-vs-AI: Perfect direct suitability — standard game tree search (Alpha-Beta, MCTS) works out of the box.
- Group games (n>4): Not applicable — strictly a 2-player abstract game.
- Physical-skill games: None; pure combinatorial strategy.
- What is lost in adaptation: Nothing.
## Implementation hints
Zero state ambiguity. Graph adjacency matrix is with exactly 16 predefined mill triplets. Average branching factor is during placement, during movement, and during flying. Suggested first milestone: implement the 24-node graph data structure and verify mill detection and sanctuary validation logic.
Download as JSON
Download the full game corpus entry for this game as structured JSON.
Download JSONCite this page
Nine Men's Morris (Bulgaria). (n.d.). Games of Countries. https://gamesofcountries.com/games/bg-bulgaria/damka-board
@misc{gamesofcountries-bg-bulgaria-damka-board,
title = {Nine Men's Morris (Bulgaria)},
year = {n.d.},
publisher = {Games of Countries},
url = {https://gamesofcountries.com/games/bg-bulgaria/damka-board}
}