Formal Specification
Nine Men's Morris / Jogo do Moinho — Formal Specification
Portugal · board-abstract · Confidence: low
← Back to game pageImplementation Suitability
Suitability: engine-readyFidelity: directGap-fills: 2
# Alquerque de Nove — AI-optimized specification
## General idea
A deterministic two-player alignment and capture game played on a 24-node graph of three concentric squares. Players progress through a drop phase, an adjacent-sliding phase, and an endgame flying phase. Forming three-in-a-row mills (*moínhos*) allows players to remove opponent pieces until one player has fewer than 3 pieces or no legal moves.
## Formal model
- **Abstraction taken:** None; formal graph representation matches the historical 24-intersection board directly.
- **Player/agent count:** 2 agents (Agent 0, Agent 1).
- **Turn model:** Sequential alternating turns across 3 phases (Drop -> Move -> Fly).
## Formal rules
R1. Board Graph: `G = (V, E)` with 24 vertices `V = {0..23}` arranged in 3 concentric squares (Outer: 0..7, Middle: 8..15, Inner: 16..23) with orthogonal midpoint connecting edges.
R2. Phase 1 (Drop Phase):
- Each agent starts with 9 pieces in reserve.
- Agents alternate placing 1 piece on any empty vertex.
- If a move creates a mill (3 aligned pieces along a valid line in `G`), the active agent selects 1 opponent piece to remove.
- Capture restriction: Cannot capture a piece in an opponent mill unless all opponent pieces are in mills.
R3. Phase 2 (Move Phase):
- Begins when all 18 pieces have been placed.
- An agent slides 1 piece from `u` to adjacent empty `v` (`(u, v) in E`).
- If a mill is completed, the agent removes 1 opponent piece (respecting the mill capture restriction).
R4. Phase 3 (Fly Phase):
- If an agent is reduced to exactly 3 pieces, that agent may move any piece to ANY empty vertex on the board (flying).
R5. Win conditions:
- An agent wins if the opponent is reduced to `<= 2` pieces.
- An agent wins if the opponent has no legal moves on their turn.
R6. Draw conditions:
- Threefold repetition of the identical board position and active player [gap-fill].
- 50 consecutive moves without a piece capture [gap-fill].
## Edge cases
- Tie at the end condition: Evaluated via threefold repetition or the 50-move non-capture rule (R6).
- A player with no legal move: Handled as an immediate loss for the immobilized player (R5).
- Repetition / cycles: Resolved by threefold repetition tracking and 50-move non-capture draw rule.
- Simultaneous claims on the same resource or position: Turns are strictly sequential.
- Player elimination mid-round: Not applicable (2-player complete game).
- Resource exhaustion (pieces, tokens, space, time): Move limit prevents infinite cyclic play.
- Termination guarantee: The 50-move non-capture cap combined with piece elimination guarantees termination.
## State representation
- Persistent state: `board: [int; 24]` (-1 = empty, 0 = Agent 0, 1 = Agent 1), `unplaced: [int; 2]`, `piece_counts: [int; 2]`, `moves_since_capture: int`, `history: Set`.
- Per-turn ephemeral state: `active_agent: int`, `mill_formed: bool`, `legal_actions: List`.
- Minimal observable information: Fully observable public state (perfect information).
## Action space
- Phase 1: `place(node: int)` and optional chained `capture(opp_node: int)`.
- Phase 2: `slide(from_node: int, to_node: int)` and optional chained `capture(opp_node: int)`.
- Phase 3: `fly(from_node: int, to_node: int)` and optional chained `capture(opp_node: int)`.
## Playability notes
- Single-player-vs-AI: Engine-ready. Solvable and playable via standard Alpha-Beta or MCTS with piece count evaluation heuristics.
- Group games (n>4): Not applicable; strictly 1v1.
- Physical-skill games: Direct abstract strategy; zero physical abstraction.
- What is lost in the adaptation: None; 100% mathematical fidelity.
## Implementation hints
Graph adjacency table of 24 nodes. Precomputed list of 16 valid 3-node mills. Suggested milestone 1: Implement the 24-node graph, mill detection logic, and the Phase 1 placement/capture loop.
Download as JSON
Download the full game corpus entry for this game as structured JSON.
Download JSONCite this page
Nine Men's Morris / Jogo do Moinho (Portugal). (n.d.). Games of Countries. https://gamesofcountries.com/games/pt-portugal/alquerque-de-nove
@misc{gamesofcountries-pt-portugal-alquerque-de-nove,
title = {Nine Men's Morris / Jogo do Moinho (Portugal)},
year = {n.d.},
publisher = {Games of Countries},
url = {https://gamesofcountries.com/games/pt-portugal/alquerque-de-nove}
}