Skip to main content
Formal Specification

Nine Men's Morris — Formal Specification

Bulgaria · board-abstract · Confidence: medium

← Back to game page

Implementation 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 (P1,P2). - **Turn model:** Strictly sequential, alternating single actions per turn. ## Formal rules R1. Board Graph: Defined as graph G=(V,E) where |V|=24 intersection nodes. Nodes are indexed 0..23. The edge set E contains 32 undirected edges forming 16 distinct collinear 3-node sets (mills/damkas): M={m1,…,m16}, where each mk∈V3. R2. Piece allocation: Each player possesses 9 pieces (Pieces(P1)=9,Pieces(P2)=9). Board state begins with all nodes empty: ∀v∈V,state(v)=Empty. R3. Phase 1 — Placement: - On turn t∈[1,18], active player places 1 piece from hand onto any node v where state(v)==Empty. - If placement forms a new mill m∈M with 3 pieces of active player's color, active player must execute action `capture_piece(u)`. - Sanctuary rule: Node u 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 u with their piece and moves it to adjacent node v∈Adj(u) where state(v)==Empty. - If move completes a mill, player executes `capture_piece(target)` per R3 sanctuary rule. R5. Phase 3 — Flying (Jump movement): - For any player Pi whose total remaining pieces on board Count(Pi)==3, Pi is in "flying" state: - On their turn, Pi may move a piece from any occupied node u to *any* empty node v∈V (not restricted to Adj(u)). R6. Win / Loss conditions: - Player Pi loses immediately if Count(Pi)<3 at any time. - Player Pi 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 V[0..23]∈{Empty,P1,P2}, pieces in hand (H1,H2)∈[0,9]2, active player ∈{P1,P2}, 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, V[node_id]==Empty, Hactive>0. - `move_piece(from_node, to_node)`: Precondition: Phase == Movement, V[from]==Pactive, V[to]==Empty, and (to∈Adj(from)∨Count(Pactive)==3). - `capture_piece(target_node)`: Precondition: Mill completed this turn, V[target]==Popponent, 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 24×24 with exactly 16 predefined mill triplets. Average branching factor is ≈10 during placement, ≈4 during movement, and ≈15 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 JSON
Cite 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}
}