Formal Specification
Nine Stones (Mancala) — Formal Specification
Uzbekistan · board-abstract · Confidence: low
← Back to game pageImplementation Suitability
Suitability: engine-readyFidelity: directGap-fills: 2
# To'qqiz tosh — AI-optimized specification
## General idea
To'qqiz tosh (Nine Stones) is a deep, two-player perfect-information abstract strategy board game of the mancala family. Played with 162 pieces distributed across two opposing rows of nine pits with central capture cauldrons, players sow pieces counter-clockwise to capture even-numbered sums in opponent pits and strategically establish permanent "Tuz" tributary pits. Structurally distinct from African mancala variants (Oware) or Kalah, starting pits retain one piece during multi-piece sowings, captures require even sums exclusively, and a captured Tuz pit diverts all future passing pieces to its owner.
## Formal model
- **Abstraction taken:** None required; the traditional game rules constitute a fully discrete, deterministic mathematical system.
- **Player/agent count:** Exactly 2 agents ().
- **Turn model:** Strictly alternating sequential turns ().
## Formal rules
R1. **Board Setup & Initial State:**
- 18 pits arranged in two rows of 9: pits belong to , pits belong to (where pit is opposite pit , and pit is opposite pit ).
- Initial pieces: for all (162 pieces total).
- Cauldrons: .
- Tuz markers: .
- Active player starts as .
R2. **Sowing Mechanics (Yurish):**
- Active player selects an owned pit where and .
- Sowing count .
- **Case A ():** ; remaining pieces are sown one by one into consecutive pits in counter-clockwise cyclic order ().
- **Case B ():** ; the single piece is placed into .
- During sowing, if a piece is placed into a pit that is designated as , that piece is immediately removed from the pit and added to .
R3. **Capture Evaluation (Qozonga tushirish):**
- Let be the pit receiving the final sown piece.
- If belongs to the opponent () and is not a Tuz:
- **Even-Count Capture:** If , all pieces in are captured:
- **Tuz Creation Declaration:** If **AND** **AND** **AND** (not symmetrical mirror pit), may declare as their permanent . All 3 pieces in are immediately moved to .
R4. **Victory Conditions:**
- **Majoritarian Threshold:** If at any point , player immediately wins the match.
- **Exact Tie:** If both players collect exactly and , the game is declared a draw (*durang*).
R5. **Impassable Turn / Starvation (Atsyz qolish):**
- If on active player 's turn, all 9 pits belonging to have 0 pieces (and no legal sowing moves exist):
- All remaining pieces resting in the opponent's pits are immediately swept into the opponent's cauldron:
- Final scores are compared per R4.
R6. [gap-fill] Loop-Breaking Draw Rule:**
- If the exact same board state (pit piece counts, cauldrons, and Tuz locations) repeats 3 times, or if 150 consecutive plies occur without any capture, the game is declared a draw.
## Edge cases
- **Tie at the end condition:** Exactly 81–81 piece score produces a formal draw (R4.2).
- **A player with no legal move:** Resolved via R5 (starvation rule sweeps remaining pieces to opponent).
- **Repetition / cycles:** Bounded strictly by R6 (threefold repetition or 150-ply non-capture limit) [gap-fill].
- **Simultaneous claims on the same resource or position:** Not applicable; turns are strictly sequential.
- **Player elimination mid-round:** Not applicable; 1v1 discrete abstract game.
- **Resource exhaustion:** The 162 pieces are conserved invariant; total pieces across pits and cauldrons always equals 162.
- **Termination guarantee:** Guaranteed by monotonic piece absorption into cauldrons towards the 82-piece threshold and the 150-ply non-capture loop-breaking cap.
## State representation
- **Persistent state:**
- Board array: .
- Cauldrons: .
- Tuz slots: .
- Active player index: .
- Ply counter , state repetition history hash set.
- **Per-turn ephemeral state:**
- Chosen pit index .
- Final landing pit .
- Pieces captured in turn .
- **Observable information:**
- Perfect information: complete board state, pit counts, cauldrons, and Tuz positions are fully visible to both players.
## Action space
- `sow(pit_index)`: Parameters: `pit_index` (for ) or (for ). Precondition: and .
- `declare_tuz(pit_index)`: Optional/automatic flag combined with `sow` when landing pit creates exactly 3 pieces under valid conditions.
## Playability notes
- **Single-player-vs-AI:** Natural. An ideal domain for Minimax, Alpha-Beta pruning, and Monte Carlo Tree Search (MCTS) agents.
- **Group games reduction:** Inherently a 2-player game.
- **Physical-skill games:** Not applicable (pure mathematical abstract).
- **What is lost:** Tactile stone clicking on carved wooden board hollows, and pastoral wooden board aesthetics.
## Implementation hints
- Represent board as an array of 18 integers with counter-clockwise indexing: `0..8` for Player 1, `9..17` for Player 2.
- Efficiently implement single-piece vs multi-piece sowing branches in the state transition function.
- Average branching factor: to legal moves per turn.
- First milestone: Implement full legal move generation, counter-clockwise sowing, and even-capture logic, validating that sum of all pieces always equals 162.
Download as JSON
Download the full game corpus entry for this game as structured JSON.
Download JSONCite this page
Nine Stones (Mancala) (Uzbekistan). (n.d.). Games of Countries. https://gamesofcountries.com/games/uz-uzbekistan/toqqiz-tosh
@misc{gamesofcountries-uz-uzbekistan-toqqiz-tosh,
title = {Nine Stones (Mancala) (Uzbekistan)},
year = {n.d.},
publisher = {Games of Countries},
url = {https://gamesofcountries.com/games/uz-uzbekistan/toqqiz-tosh}
}