Skip to main content
Formal Specification

Thin Hama (Three Men's Morris / Three-in-a-Row) — Formal Specification

Maldives · board-abstract · Confidence: low

← Back to game page

Implementation Suitability

Suitability: engine-readyFidelity: directGap-fills: 2
# Thin Hama — AI-optimized specification ## General idea Thin Hama is a traditional two-player alignment board game of the Three Men's Morris family played on a 9-point grid. Each player controls three pieces across two phases: an initial drop phase placing pieces on vacant intersections, followed by a sliding movement phase along marked lines. The objective is to achieve a three-in-a-row alignment (*hama*). ## Formal model - **Abstraction taken:** None; the game is a finite discrete state machine. - **Player/agent count:** 2 players (Player 0: Cowries, Player 1: Coral Stones). - **Turn model:** Strictly sequential, alternating turns. ## Formal rules R1. Board Graph: G=(V,E) with |V|=9 intersection points indexed (r,c) for r,c∈{0,1,2}, connected by 8 orthogonal edges and 4 diagonal edges crossing through the center (1,1). R2. Phase 1 (Drop Phase): - Both players start with 3 unplaced counters in hand. Board is empty. - Players alternate placing 1 counter onto any vacant vertex v∈V. - If a player forms 3-in-a-row during Phase 1, that player wins immediately. R3. Phase 2 (Movement Phase): - Begins when all 6 counters have been placed on the board. - On their turn, a player must slide one of their counters along an edge e=(u,v)∈E to an adjacent empty vertex v. R4. Win Condition: The first player to position their 3 counters along any straight line (horizontal row, vertical column, or diagonal line passing through the center) achieves *hama* and wins the game. R5. [gap-fill] Draw Rule: If the board state repeats three times identically, or if 30 consecutive moves occur in Phase 2 without a win, the game is declared a draw. ## Edge cases - **Tie at the end condition:** Resolved by threefold repetition or move cap draw rule (R5). - **A player with no legal move:** If all three pieces of a player are trapped with no adjacent empty vertex, that player [gap-fill] loses the game. - **Repetition / cycles:** Explicitly bounded by R5 threefold repetition / move cap. - **Simultaneous claims on the same resource or position:** Not applicable; turns are strictly sequential. - **Player elimination mid-round:** Not applicable; pieces are never captured, only repositioned. - **Resource exhaustion:** Exactly 3 pieces per player; space is 9 vertices. - **Termination guarantee:** Guaranteed by finite state space and draw cycle limits. ## State representation - **Persistent state:** 9-element array (values: Empty, Player 0, Player 1), unplaced piece counts for both players (0..3), active player index (0 or 1), half-move counter. - **Per-turn ephemeral state:** List of legal destination vertices. - **Observable information:** Perfect information. ## Action space - `place_piece(vertex_id)`: Precondition: Phase 1 active, `unplaced_count > 0`, `board[vertex_id] == Empty`. - `slide_piece(from_vertex, to_vertex)`: Precondition: Phase 2 active, `board[from_vertex] == active_player`, `board[to_vertex] == Empty`, `(from_vertex, to_vertex) in Edges`. ## Playability notes - **Single-player-vs-AI:** Ideal for Minimax with Alpha-Beta pruning; game tree is small enough for complete strongly-solved retrograde analysis. - **Group games (n>4):** Not applicable; purely 2-player. - **Physical-skill games:** Not applicable. - **What is lost:** Tactile scratching of lines in coral sand. ## Implementation hints Extremely simple. Total state space is under 39=19,683 states, easily solvable via brute-force depth-first search in milliseconds. Suggested milestone: write complete game solver in Python.

Download as JSON

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

Download JSON
Cite this page

Thin Hama (Three Men's Morris / Three-in-a-Row) (Maldives). (n.d.). Games of Countries. https://gamesofcountries.com/games/mv-maldives/thin-hama

@misc{gamesofcountries-mv-maldives-thin-hama,
  title = {Thin Hama (Three Men's Morris / Three-in-a-Row) (Maldives)},
  year = {n.d.},
  publisher = {Games of Countries},
  url = {https://gamesofcountries.com/games/mv-maldives/thin-hama}
}