Formal Specification
Nine Men's Morris (Merels / Mill) — Formal Specification
United Kingdom · board-abstract · Confidence: medium
← Back to game pageImplementation Suitability
Suitability: engine-readyFidelity: directGap-fills: 1
# Nine Men's Morris — AI-optimized specification
## General idea
A deterministic 2-player alignment and capture abstract board game played on a 24-point graph of three concentric squares. The match progresses through a drop phase, a sliding movement phase, and an endgame flying phase. Aligning three pieces along a valid line (*a mill*) grants the right to remove an opponent's un-milled piece.
## Formal model
- **Abstraction taken:** None (`fidelity_class: direct`). The game is naturally discrete and fully deterministic.
- **Board Graph:** 24 vertices `V = {0..23}` arranged in three concentric 8-vertex rings (Outer: 0..7, Middle: 8..15, Inner: 16..23). Edge set `E` connects adjacent ring neighbors and perpendicular midpoint bridges (e.g. `(1, 9)`, `(9, 17)`, `(3, 11)`, `(11, 19)`, etc.).
- **Player/agent count:** 2 agents (`P1` = White/1, `P2` = Black/2).
- **Turn model:** Strictly alternating sequential turns.
## Formal rules
R1. **Initial State:** Graph `V` is empty (`state[v] = 0` for all `v in V`). Unplaced pieces: `unplaced_P1 = 9, unplaced_P2 = 9`.
R2. **Phase 1 (Placement):**
- While `unplaced_active > 0`, the active player places one piece on any vacant node `v in V` (`state[v] == 0`).
- `unplaced_active -= 1`.
- If this placement forms a new Mill (3 collinear friendly pieces): Player executes `capture(u)` where `state[u] == opponent` and `u` is not in a mill (unless all opponent pieces are in mills).
R3. **Phase 2 (Movement):**
- Once both players have `unplaced == 0`, the active player slides a piece from `v` to adjacent vacant node `u` where `(v, u) in E` and `state[u] == 0`.
- If this slide forms a new Mill: Player executes `capture(target_node)` per mill immunity rules.
R4. **Phase 3 (Flying):**
- If an active player possesses exactly 3 pieces on the board, their pieces may jump to *any* vacant node `u in V` (`state[u] == 0`), ignoring edge adjacency.
R5. **Capture Legality (Mill Immunity):**
- When executing `capture(u)`: Node `u` must contain an opponent piece.
- If opponent has at least one piece NOT in a mill, `u` MUST NOT be in a mill.
- If ALL opponent pieces are currently in mills, any opponent piece may be captured.
R6. **Win / Loss Conditions:**
- Player `P` loses immediately if `pieces_on_board(P) < 3` during Phase 2/3.
- Player `P` loses immediately if it is `P`'s turn in Phase 2/3 and `P` has no legal moves (all pieces blocked).
R7. [gap-fill] Draw Conditions:**
- Threefold Repetition: The game is a draw if the identical board state and active player occur 3 times.
- 50-Move Rule: If 50 consecutive plies occur without a capture or mill formed, the game ends in a draw.
## Edge cases
- **Tie at the end condition:** Handled by R7 (threefold repetition or 50-move rule).
- **A player with no legal move:** Handled by R6: having no legal moves during Phase 2 constitutes an immediate loss for the active player.
- **Repetition / cycles:** Bounded by R7 (threefold repetition rule).
- **Simultaneous claims on the same resource:** Not applicable; strictly alternating turns.
- **Player elimination mid-round:** Handled by R6: piece count dropping below 3 ends the game immediately in opponent's victory.
- **Resource exhaustion:** Board and pieces are finite (24 nodes, 18 total pieces).
- **Termination guarantee:** Guaranteed by finite state graph combined with the 50-move non-capture draw limit and threefold repetition rule.
## State representation
- **Persistent state:** `board: array[24] of int in {0, 1, 2}`, `unplaced_P1: int (0..9)`, `unplaced_P2: int (0..9)`, `pieces_on_board: [int, int]`, `active_player: int (1 or 2)`, `phase: enum [PLACEMENT, MOVEMENT, FLYING]`, `halfmove_clock: int`, `position_history: list of hash`.
- **Per-turn ephemeral state:** `mill_formed: bool`, `pending_capture: bool`.
- **Observable information:** Perfect complete information game (zero hidden state).
## Action space
- `place(v: int in [0..23])`: Placement action.
- `move(src: int, dst: int)`: Movement action.
- `capture(target: int)`: Capture action following a mill.
## Playability notes
- **Single-player-vs-AI:** Ideal game for Minimax / Alpha-Beta pruning, MCTS, or reinforcement learning. Solved game (known theoretical draw under perfect play).
- **Group games reduction:** Inherently a 1v1 game.
- **Physical-skill games:** Not applicable (pure abstract strategy).
- **What is lost in the adaptation:** Zero fidelity loss; the digital graph reproduces the physical board perfectly.
## Implementation hints
- Compact bitboard representation: Board state can be represented with 48 bits (two 24-bit integers for P1 and P2 bitmasks).
- Pre-compute mill lookup tables (16 possible mills: 8 horizontal/vertical triples across rings, 8 midpoint radial triples).
- First milestone: Implement board bitboard, legal move generator, mill detection, and verify minimax search to depth 6 in <10ms.
Download as JSON
Download the full game corpus entry for this game as structured JSON.
Download JSONCite this page
Nine Men's Morris (Merels / Mill) (United Kingdom). (n.d.). Games of Countries. https://gamesofcountries.com/games/gb-united-kingdom/nine-mens-morris
@misc{gamesofcountries-gb-united-kingdom-nine-mens-morris,
title = {Nine Men's Morris (Merels / Mill) (United Kingdom)},
year = {n.d.},
publisher = {Games of Countries},
url = {https://gamesofcountries.com/games/gb-united-kingdom/nine-mens-morris}
}