Skip to main content
Formal Specification

Fourteen Pits / Many Pits Mancala — Formal Specification

India · board-abstract · Confidence: low

← Back to game page

Implementation Suitability

Suitability: engine-readyFidelity: directGap-fills: 2
# Pallanguzhi — AI-optimized specification ## General idea Pallanguzhi is South India's classical two-player mancala game played on a 14-pit wooden board (two rows of seven) with 70 tamarind seeds. Players take turns sowing seeds counter-clockwise across multi-lap continuous relays, capturing seeds from pits following an empty depression (*thattu*), and harvesting four-seed "cows" (*pasu*) that form on their home territory. Across successive rounds, seed deficits convert unfilled pits into inactive "rubbish pits" (*kasavu kuzhi*), progressively shrinking the loser's playable domain until total bankruptcy. ## Formal model - **Abstraction taken:** Direct representation of the 14-pit cyclic mancala array. Board pits are indexed cyclically 0,1,…,13, where Player 0 owns pits 0–6 (South row) and Player 1 owns pits 7–13 (North row). - **Player/agent count:** 2 agents (P0,P1). - **Turn model:** Alternating sequential turns with deterministic multi-lap cascade resolutions. ## Formal rules R1. **Initial Setup (Round 1):** - 14 pits arranged in a directed ring 0→1→⋯→13→0. - Each pit i∈{0,…,13} is populated with exactly 5 seeds (S[i]=5, total 70 seeds). - Personal stores: Store[P0]=0, Store[P1]=0. - Rubbish pit mask: is_rubbish[i]=false for all i. R2. **Turn Initiation & Sowing:** - On their turn, player Pk selects an active, non-empty, non-rubbish pit i∈Pits(Pk) where S[i]>0. - Player scoops all S[i] seeds: hand←S[i], S[i]←0. - Player sows seeds one by one into subsequent pits (i+1,i+2,…(mod14)). - **Rubbish Pit Bypass:** Any pit where is_rubbish[j]=true is strictly skipped during sowing (hand is not decremented, no seed is placed). R3. **The "Cow" (*Pasu*) Instant Harvest:** - During any sowing step, if the seed count of any pit j reaches exactly 4 (S[j]=4): - The 4 seeds are immediately harvested by the owner of the row containing pit j: owner(j)={P0,if 0≤j≤6P1,if 7≤j≤13 Store[owner(j)]←Store[owner(j)]+4,S[j]←0 - This harvest occurs instantly regardless of whose turn it is. R4. **Multi-Lap Continuation & Captures:** - When the last seed in hand is deposited into pit p: - Let next1=(p+1)(mod14) and next2=(p+2)(mod14) (skipping rubbish pits). - **Case 1 (Lap Sowing):** If S[next1]>0, player picks up all seeds from next1 (hand←S[next1],S[next1]←0) and continues sowing counter-clockwise. - **Case 2 (Capture / *Thattu*):** If S[next1]==0: - The player captures all seeds in pit next2: Store[Pk]←Store[Pk]+S[next2],S[next2]←0. - [gap-fill: standard thattu rule] If the pit following the captured pit (next3) is also empty, the player additionally captures all seeds in next4 (double capture). - The turn terminates. - **Case 3 (Stall / *Kothu*):** If both next1 and next2 are empty, the turn terminates with zero capture. R5. **Round Termination & Territory Reduction:** - A round ends when the active player has no non-empty playable pits remaining on their side of the board. Any remaining seeds on the board are swept into the respective pit owners' stores. - **Reset Phase for Next Round:** - Both players attempt to repopulate their 7 home pits with 5 seeds each from their accumulated Store. - Any surplus seeds beyond the required 35 are set aside as permanent profit. - If player Pk possesses fewer than 35 seeds, they fill as many full pits (5 seeds each) as possible from left to right. - Any unfilled home pits are marked as "Rubbish Pits" (is_rubbish[j]←true). - Any remainder seeds (<5) that cannot fill a full pit are retained in the player's store. R6. **Match Victory:** - A player who cannot fill even a single home pit (possessing <5 seeds at round reset) is declared bankrupt. - The opposing player wins the match. - [gap-fill] If a single round exceeds 150 turns without a capture or pasu harvest, the round terminates and seeds are scored by current store counts. ## Edge cases - **Tie at the end condition:** Not applicable — match ends only upon total seed bankruptcy of one player; total seed invariant (70 seeds) ensures asymmetry. - **A player with no legal move:** When an active player has 0 seeds across all active home pits, the round ends immediately, triggering R5. - **Repetition / cycles:** Multi-lap sowing loops are strictly finite because each seed placement and pasu harvest decrements or redistributes hand contents; the 150-turn cap in R6 breaks infinite non-capturing cycles. - **Simultaneous claims on the same resource or position:** Pasu harvest (R3) resolves deterministically based on territorial ownership of the 4-seed pit. - **Player elimination mid-round; turn order repair:** Not applicable — strictly 2 players; round resets handle territorial contraction. - **Resource exhaustion (pieces, tokens, space, time):** Total seed mass is invariant (∑S[i]+∑Store[Pk]=70). - **Termination guarantee: why the game provably ends:** Deficit rounds permanently convert pits to rubbish pits (is_rubbish→true), strictly reducing board capacity until one player reaches 0 pits. ## State representation - **Persistent state:** - Pits array: S[0…13]∈ℕ14. - Personal stores: (Store[P0],Store[P1])∈ℕ2. - Rubbish pit mask: is_rubbish[0…13]∈{true,false}14. - Active player Pactive∈{P0,P1}; Round index ∈ℕ. - **Per-sowing ephemeral state:** - hand∈ℕ: current seeds being distributed. - current_pit_idx∈[0,13]. - **Observable information:** Fully observable game state (perfect information). ## Action space - `sow_pit(pit_index)`: where pit_index∈Pits(Pactive), subject to preconditions: S[pit_index]>0 and is_rubbish[pit_index]=false. ## Playability notes - **Single-player-vs-AI:** Highly natural for alpha-beta search or Monte Carlo Tree Search. The deterministic cascade sowing and combinatorial depth create a profound abstract calculation space. - **Group games (n>4):** Not applicable; purely a 2-player duel. - **Physical-skill games:** Not applicable; abstract strategy. - **What is lost in the adaptation:** The sensory rhythm of dropping smooth tamarind seeds into hollowed rosewood pits and the communal chanting during night-long festival vigils. ## Implementation hints - Implement the sowing cycle as a `while hand > 0` loop with a helper `get_next_valid_pit(idx)` that automatically skips rubbish pits. - Branching factor: Exceptionally low: at most 7 choices per turn (often 2–5 valid non-empty pits), allowing deep alpha-beta search depths (d≥16). - Obvious representational trap: Forgetting that the "Pasu" (4-seed harvest) awards seeds to the *owner of that half of the board*, NOT necessarily to the player currently sowing. - Suggested first milestone: Implement a single-round sowing engine with lap continuation, pasu harvest, and thattu capture; verify seed conservation (∑=70).

Download as JSON

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

Download JSON
Cite this page

Fourteen Pits / Many Pits Mancala (India). (n.d.). Games of Countries. https://gamesofcountries.com/games/in-india/pallanguzhi

@misc{gamesofcountries-in-india-pallanguzhi,
  title = {Fourteen Pits / Many Pits Mancala (India)},
  year = {n.d.},
  publisher = {Games of Countries},
  url = {https://gamesofcountries.com/games/in-india/pallanguzhi}
}