Formal Specification
Andrez (Cypriot Three/Nine Men's Morris) — Formal Specification
Cyprus · board-abstract · Confidence: low
← Back to game pageImplementation Suitability
Suitability: engine-readyFidelity: directGap-fills: 2
# Andrez — AI-optimized specification
## General idea
A deterministic 2-player abstract alignment strategy game played on an unweighted undirected planar graph. Players alternate placing tokens onto graph vertices and subsequently sliding them along edges to form 3-in-a-row alignments (mills), capturing opponent pieces.
## Formal model
- **Abstraction taken:** Direct representation. The board is represented as an undirected graph .
- For 3-Man Andrez: (8 boundary vertices + 1 central vertex), with all orthogonal and diagonal mill lines defined.
- For 9-Man Andrez: (three concentric 8-vertex squares connected at side midpoints).
- **Player/agent count:** 2 agents ().
- **Turn model:** Strictly sequential alternating turns. moves first.
## Formal rules
R1. **State Space & Setup:**
- Board occupancy , initially .
- Pieces in hand: (where for 3-Man, for 9-Man).
- Pieces on board: .
- Phase: .
R2. **Placement Phase:**
- While , active player executes `place(v)` on any such that .
- Updates: , , .
- If placing on forms a new mill (a 3-vertex clique along a predefined line with all vertices occupied by ):
- In 3-Man: immediately wins (game terminates).
- In 9-Man: executes `capture(u)` where and is not part of an opponent mill (unless all opponent pieces are in mills). , .
- When and , transition to phase.
R3. **Movement Phase:**
- Active player executes `move(u, v)` where , , and .
- If has (and optional flying rule is enabled [gap-fill]), may execute `fly(u, v)` to any vacant without edge adjacency constraint.
- If the move completes a new mill, executes `capture(w)` of an eligible opposing piece.
R4. **Capture Legality:**
- Piece belonging to opponent can only be captured if does not belong to a closed mill, unless all opposing pieces on board belong to mills.
R5. **Win / Loss Conditions:**
- Player wins if opponent is reduced to pieces on board (in 9-Man Andrez).
- Player wins if opponent has no legal moves on their turn.
R6. [gap-fill] **Draw / Repetition Rule:** If the exact same board state and active player recurs 3 times (threefold repetition), or if 50 consecutive moves occur without a capture or mill creation, the game is declared a draw.
## Edge cases
- **Tie at the end condition:** Handled by R6 (threefold repetition or 50-move limit without capture results in a draw).
- **A player with no legal move:** If an active player in movement phase has no legal `move()` action, that player immediately loses (per R5).
- **Repetition / cycles:** Explicitly broken by the threefold repetition and 50-move draw rule in R6.
- **Simultaneous claims on the same resource or position:** Not applicable — strictly sequential turns on discrete graph vertices.
- **Player elimination mid-round:** Not applicable — exactly 2 players; losing conditions terminate the match.
- **Resource exhaustion:** Hand tokens decrement to 0 during placement; board pieces are invariant or decreasing via captures.
- **Termination guarantee:** Guaranteed by state space finiteness and R6 (50-move rule and repetition draw bounds).
## State representation
- **Persistent state:** Board vertex array , hand counts , on-board counts , active player turn , phase indicator, history hash set for repetition detection, half-move counter since last capture.
- **Observable information:** Perfect information — full board state is completely observed by both agents.
## Action space
- `place(v)`: Place a hand piece on empty vertex ().
- `move(u, v)`: Slide piece from to adjacent empty vertex ().
- `fly(u, v)`: Move piece from to any empty vertex (valid only when ).
- `capture(w)`: Remove opponent piece from vertex upon completing a mill.
## Playability notes
- **Single-player-vs-AI:** Direct and standard. Solvable via minimax, alpha-beta pruning, or MCTS.
- **Group games ():** Not applicable — intrinsically a 2-player zero-sum abstract game.
- **Physical-skill games:** Not applicable — zero physical dexterity required; pure combinatorial strategy.
- **What is lost:** Nothing — formalization is a complete, lossless `direct` model.
## Implementation hints
Graph representation via adjacency matrix or adjacency list. Precompute all collinear 3-tuples (mill sets) as bitmasks for mill detection. State evaluation can prioritize piece count, formed mills, blocked opposing pieces, and potential double-mill traps. First milestone: implement 3-Man Andrez with full minimax before expanding to 24-vertex 9-Man graph.
Download as JSON
Download the full game corpus entry for this game as structured JSON.
Download JSONCite this page
Andrez (Cypriot Three/Nine Men's Morris) (Cyprus). (n.d.). Games of Countries. https://gamesofcountries.com/games/cy-cyprus/andrez
@misc{gamesofcountries-cy-cyprus-andrez,
title = {Andrez (Cypriot Three/Nine Men's Morris) (Cyprus)},
year = {n.d.},
publisher = {Games of Countries},
url = {https://gamesofcountries.com/games/cy-cyprus/andrez}
}