Formal Specification
Syrian Mancala — Formal Specification
Syria · board-abstract · Confidence: medium
← Back to game pageImplementation Suitability
Suitability: engine-readyFidelity: directGap-fills: 3
# Al-Mankalah — AI-optimized specification
## General idea
A two-player perfect-information combinatorial game played on a 2x7 circular pit board with 98 seeds. Players perform multi-lap relay sowing, scooping and re-distributing seeds counter-clockwise until landing in an empty pit, capturing seeds when an opponent's pit is brought to specific target counts (2 or 4).
## Formal model
- **Abstraction taken:** Direct representation. 14 pits indexed `0..13` in counter-clockwise order (Player 0 controls pits `0..6`; Player 1 controls pits `7..13`).
- **Player/agent count:** 2 discrete agents.
- **Turn model:** Sequential alternating turns. Sowing is deterministic and executes atomically per selected starting pit.
## Formal rules
R1. State setup: Array of 14 integers `pits = [7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7]`; scores `score = [0, 0]`.
R2. On agent 's turn, choose index such that belongs to agent 's row ( for , for ) and `pits[k] > 0`.
R3. Relay Sowing execution:
- Lift all seeds: `hand = pits[k]`, `pits[k] = 0`, `curr = k`.
- While `hand > 0`:
- `curr = (curr + 1) % 14`
- `pits[curr] += 1`
- `hand -= 1`
- If `hand == 0` and `pits[curr] > 1`:
- `hand = pits[curr]`, `pits[curr] = 0` (continue relay sowing).
R4. Capture evaluation: When sowing terminates (`hand == 0` and final seed lands in a pit that was previously empty, so `pits[curr] == 1`):
- [gap-fill] If `curr` is on the opponent's side and `pits[curr]` equals 2 or 4 (or per standard Levantine rules, if the preceding pit in the chain equals 2 or 4), agent captures those seeds: `score[p] += pits[curr]`, `pits[curr] = 0`.
- Continue checking backwards along the track: while preceding pit is on opponent's side and has 2 or 4 seeds, capture those seeds as well.
R5. Starvation constraint: An agent must choose a move that supplies seeds to the opponent's side if the opponent has zero seeds on their side and such a move is available.
R6. Win condition: Game ends when an agent reaches `score[p] >= 50` or when no legal moves remain. If seeds remain on the board when no legal moves exist, [gap-fill] each player collects the seeds remaining on their own side. Highest score wins.
## Edge cases
- **Tie at the end condition:** If both players finish with exactly 49 captured seeds, the match is declared a draw.
- **A player with no legal move:** If an agent's pits are all 0 and the opponent cannot sow seeds into their side, the game ends immediately and remaining seeds are tallied.
- **Repetition / cycles:** Sowing cycles without captures are bounded; [gap-fill] if a board state recurs 3 times without any change in captured scores, the game terminates and remaining board seeds are credited to their respective sides.
- **Simultaneous claims on the same resource or position:** Not applicable; turns are strictly sequential.
- **Player elimination mid-round; turn order repair:** Not applicable; 2-agent fixed duel.
- **Resource exhaustion:** Total seed count is conserved ().
- **Termination guarantee:** Each capture strictly decreases total on-board seeds. Combined with the 3-fold repetition state-breaker, termination is strictly guaranteed in finite steps.
## State representation
- Persistent state:
- `pits`: fixed array of length 14, containing non-negative integers summing to .
- `score`: array of length 2 `[int, int]`.
- `current_player`: integer in `{0, 1}`.
- Per-turn ephemeral state: None (move computation is fully deterministic).
- Observable information: Fully observable, complete information.
## Action space
- `sow_pit(pit_idx)`: Select pit index (if player 0) or (if player 1) where `pits[k] > 0`.
## Playability notes
- Single-player-vs-AI: Engine-ready; standard Alpha-Beta minimax with transposition tables or MCTS searches the tree cleanly. Branching factor is at most 7 per turn.
- Group games (n>4): Not applicable; inherently a 2-agent abstract duel.
- Physical-skill games: Not applicable (pure mathematical strategy).
- What is lost in the adaptation: The tactile experience of wooden pits, rhythmic pebble clicking, and coffee-house social banter.
## Implementation hints
- Represent the 14-pit board as a circular buffer.
- Ensure the relay-sowing loop properly detects infinite sowing loops in simulation (preventing runaway while-loops during evaluation).
Download as JSON
Download the full game corpus entry for this game as structured JSON.
Download JSONCite this page
Syrian Mancala (Syria). (n.d.). Games of Countries. https://gamesofcountries.com/games/sy-syria/al-mankalah
@misc{gamesofcountries-sy-syria-al-mankalah,
title = {Syrian Mancala (Syria)},
year = {n.d.},
publisher = {Games of Countries},
url = {https://gamesofcountries.com/games/sy-syria/al-mankalah}
}