Skip to main content
Formal Specification

The Mill (Belarusian Nine Men's Morris) — Formal Specification

Belarus · board-abstract · Confidence: medium

← Back to game page

Implementation Suitability

Suitability: engine-readyFidelity: directGap-fills: 0
# Mlyn (Млын) — AI-optimized specification ## General idea A classical two-player abstract alignment board game played on a 24-point grid of three concentric squares linked at side midpoints. Players place and slide nine pieces to construct three-in-a-row "mills", capturing opponent pieces upon each mill formation until an opponent is reduced to two pieces or immobilized. ## Formal model - **Abstraction taken:** Direct representation as an undirected graph G=(V,E) with |V|=24 vertices and |E|=32 edges, containing 16 collinear triples (mills). - **Player/agent count:** 2 agents (P1,P2). - **Turn model:** Strictly alternating sequential turns (P1→P2→P1…). ## Formal rules R1. Board & Piece Setup: - Graph G=(V,E) with 24 vertices is initially empty. - Each player holds an unplaced piece inventory hand[Pi]=9 and on-board piece set board[Pi]=∅. R2. Phase 1 — Drop Phase (while hand[P1]>0 or hand[P2]>0): - Active player P selects an empty vertex v∈V∖(board[P1]∪board[P2]) and executes `place_piece(v)`. - hand[P] decrements by 1; v is added to board[P]. - If v completes a mill (a collinear 3-in-a-row in board[P]), P executes `capture_piece(u)` (R4). - Phase 1 ends when hand[P1]=hand[P2]=0. R3. Phase 2 & 3 — Movement & Flying Phase: - If |board[P]|>3 (Phase 2): Active player P selects u∈board[P] and adjacent vacant vertex v with (u,v)∈E, executing `slide_piece(u, v)`. - If |board[P]|=3 (Phase 3 — Flying): Active player P selects u∈board[P] and *any* vacant vertex v∈V∖(board[P1]∪board[P2]), executing `fly_piece(u, v)`. - If the move forms a new mill (or re-closes an opened mill), P executes `capture_piece(u)` (R4). R4. Capture Resolution: - P selects an opponent piece u∈board[Popp] and removes it from the board. - **Mill Protection Constraint:** u cannot be part of an opponent mill unless *all* pieces in board[Popp] are currently in mills. R5. Win, Loss, and Draw Conditions: - **Loss by Reduction:** If during Phase 2/3 |board[P]|<3, player P immediately loses; Popp wins. - **Loss by Blockade:** If on player P's turn during Phase 2, P has no legal moves (all pieces blocked), P immediately loses; Popp wins. - **Draw by Repetition:** If the identical full board position and turn state occurs for the 3rd time, the game terminates in a draw. - **Draw by Inaction:** If 50 consecutive plies (25 full rounds) pass without any capture, the game terminates in a draw. ## Edge cases - Tie at the end condition: Handled explicitly by R5 (3-fold repetition or 50-move rule results in a draw; win/loss is otherwise decisive). - A player with no legal move: Handled by R5 (Loss by Blockade). - Repetition / cycles: Bounded by mandatory 3-fold repetition draw and 50-move capture counter. - Simultaneous claims on the same position: Not applicable; strictly sequential turns on discrete graph vertices. - Elimination mid-round and turn-order repair: Captured pieces are removed from the board; turn order alternates between the two players without skipping. - Resource exhaustion: Drop phase terminates deterministically after exactly 18 plies when hand inventories reach 0. - Termination guarantee: The combination of the 50-move no-capture counter and the 3-fold repetition rule bounds total game length to a finite number of plies, guaranteeing deterministic termination. ## State representation - Persistent state: - `board`: Map of vertex ID v∈[0,23]→{EMPTY,P1,P2}. - `hand`: Map of player ID → integer unplaced count [0,9]. - `active_player`: ID ∈{P1,P2}. - `ply_count_since_capture`: Integer [0,50]. - `position_history`: Frequency table of board hash states. - Ephemeral state: - `pending_capture`: Boolean indicating whether active player must submit a capture action before turn ends. - Observable information: Perfect information; complete board state is fully observable to both players. ## Action space - `place_piece(vertex)`: Place unplaced piece on empty vertex (precondition: Phase 1, `hand[active] > 0`). - `slide_piece(from_vertex, to_vertex)`: Slide piece along edge to vacant vertex (precondition: Phase 2, adjacent edge). - `fly_piece(from_vertex, to_vertex)`: Jump piece to any vacant vertex (precondition: Phase 3, |board|=3). - `capture_piece(target_vertex)`: Remove eligible opponent piece (precondition: mill formed on current ply). ## Playability notes - Single-player-vs-AI: Perfect domain for alpha-beta minimax or MCTS engines. - Group reduction: Already a native 2-agent zero-sum game. - Physical-skill games: Purely strategic board game with no physical dexterity elements. - What is lost: Tactile handling of smooth river stones and wooden carving aesthetics. ## Implementation hints Represent the 24 vertices as bitboards (three 8-bit rings) or a flat graph with precomputed mill bitmasks (16 bitmasks of 3 vertices). First milestone: implement drop phase and mill-detection bitwise checks before adding movement and flying transitions.

Download as JSON

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

Download JSON
Cite this page

The Mill (Belarusian Nine Men's Morris) (Belarus). (n.d.). Games of Countries. https://gamesofcountries.com/games/by-belarus/mlyn

@misc{gamesofcountries-by-belarus-mlyn,
  title = {The Mill (Belarusian Nine Men's Morris) (Belarus)},
  year = {n.d.},
  publisher = {Games of Countries},
  url = {https://gamesofcountries.com/games/by-belarus/mlyn}
}