Skip to main content
Formal Specification

The Mill (Nine Men's Morris / Dzirnavu Spēle) — Formal Specification

Latvia · board-abstract · Confidence: low

← Back to game page

Implementation Suitability

Suitability: engine-readyFidelity: directGap-fills: 2
# Dzirnavas — AI-optimized specification ## General idea A traditional two-player abstract alignment and capture board game played on a 24-node planar graph formed by three concentric squares connected at midpoints. Players place, slide, and fly nine pieces each, attempting to form linear trios ("mills") to capture enemy pieces until the opponent is reduced to two pieces or immobilized. ## Formal model - **Abstraction taken:** Direct representation. The physical board is formalized as a fixed planar graph G=(V,E) with |V|=24 nodes and |E|=32 undirected edges, with a defined set M of 16 collinear 3-node mill lines. - **Player/agent count:** 2 agents (P1=White, P2=Black). - **Turn model:** Strictly sequential, strictly alternating. ## Formal rules R1. **Board topology:** 24 intersection nodes arranged as 3 concentric squares (outer, middle, inner) with coordinates (s,p) where square s∈{0,1,2} and position p∈{0…7} (0: top-left, 1: top-mid, 2: top-right, 3: mid-right, 4: bot-right, 5: bot-mid, 6: bot-left, 7: mid-left). Edges connect adjacent nodes along each square perimeter, plus radial edges connecting midpoints (0,p)−(1,p)−(2,p) for p∈{1,3,5,7}. R2. **Piece inventory:** Each player begins with an off-board reserve of 9 pieces. The board starts empty. R3. **Phase 1 — Placement:** - Players alternate placing 1 piece from their reserve onto any vacant node v∈V. - If placement creates a 3-in-a-row mill along any line in M, the placing player immediately executes a `capture(v)` action on an opponent piece on the board. - Protected mill rule: an opponent piece in an active mill cannot be selected for capture unless all opponent pieces on the board are currently part of mills. - Phase 1 terminates after 18 turns (when all 18 pieces have been placed). R4. **Phase 2 — Movement (Sliding):** - The active player selects one of their pieces on node u and moves it to an adjacent vacant node v such that (u,v)∈E. - If the move completes a mill, the active player immediately captures an opponent piece (subject to the protected mill rule in R3). R5. **Phase 3 — Flying (Hopping):** - As soon as a player has exactly 3 pieces remaining on the board, that player enters the flying phase: on their turn, they may move a piece from node u to any unoccupied node v∈V, ignoring edge adjacency. - The opposing player continues under Phase 2 sliding rules until also reduced to 3 pieces. R6. **Win condition:** A player wins immediately if: - The opponent is reduced to 2 pieces on the board during Phase 2 or Phase 3. - The opponent has no legal moves on their turn (immobilization). R7. **Draw condition:** The game is declared a draw if: - The exact same board position and active player turn repeats 3 times [gap-fill: standard threefold-repetition draw]. - 50 consecutive moves occur without a piece capture by either player [gap-fill: standard 50-move rule]. ## Edge cases - Tie at the end condition: draws occur strictly via R7 (threefold repetition or 50-move captureless counter); no simultaneous wins exist. - A player with no legal move: resolves per R6 as an immediate loss for the player unable to move. - Repetition / cycles: bounded and broken by R7 threefold-repetition and 50-move rules. - Simultaneous claims on the same resource or position: not applicable — turns are strictly sequential; a piece occupies a vacant node exclusively. - Player elimination mid-round: not applicable — 2-player zero-sum game; piece reduction down to 2 constitutes immediate game end. - Resource exhaustion: piece reserves are completely placed during Phase 1 (18 total turns); board capacity is bounded at 24 nodes. - Termination guarantee: guaranteed by the finite game tree bounded by R7 (50-move rule and threefold repetition) and monotonic piece captures. ## State representation - Persistent state: board graph G=(V,E), predefined mill lines M, turn history / state hash dictionary for repetition detection, captureless-move counter. - Per-turn ephemeral state: node occupancy array V→{Empty,P1,P2}, unplaced piece reserves (r1,r2), active player turn, pending capture state flag. - Observable information: full public observability — perfect information with zero hidden state. ## Action space - `place(node_id)`: place piece from reserve on vacant node. Precondition: Phase 1, reserve >0, `node_id` is empty. - `slide(from_node, to_node)`: move piece along edge. Precondition: Phase 2, `from_node` contains active player piece, `to_node` is empty, (from,to)∈E. - `fly(from_node, to_node)`: move piece anywhere. Precondition: Phase 3 (pieces =3), `from_node` contains active player piece, `to_node` is empty. - `capture(node_id)`: remove opponent piece. Precondition: pending capture flag is true, `node_id` contains opponent piece, protected mill condition satisfied. ## Playability notes - Single-player-vs-AI: natural — perfect information abstract strategy game, optimal for Minimax, Alpha-Beta pruning, or MCTS agents. - Group games (n>4): not applicable — strictly a 2-player duel. - Physical-skill games: not applicable — pure discrete abstract strategy. - What is lost: nothing — the discrete graph model maps 100% losslessly to traditional board play. ## Implementation hints Extremely low implementation complexity. State representation can be encoded in bitboards (three 24-bit integers for White, Black, and Empty). Precomputing the 16 mill bitmasks enables O(1) mill-detection and legal-move generation. First milestone: implement board graph, 3-phase move generator, and R6/R7 termination checks.

Download as JSON

Download the full game corpus entry for this game as structured JSON.

Download JSON
Cite this page

The Mill (Nine Men's Morris / Dzirnavu Spēle) (Latvia). (n.d.). Games of Countries. https://gamesofcountries.com/games/lv-latvia/dzirnavas

@misc{gamesofcountries-lv-latvia-dzirnavas,
  title = {The Mill (Nine Men's Morris / Dzirnavu Spēle) (Latvia)},
  year = {n.d.},
  publisher = {Games of Countries},
  url = {https://gamesofcountries.com/games/lv-latvia/dzirnavas}
}