Skip to main content
Formal Specification

Malay Mancala — Formal Specification

Singapore · board-abstract · Confidence: high

← Back to game page

Implementation Suitability

Suitability: engine-readyFidelity: directGap-fills: 2
# Congkak — AI-optimized specification ## General idea Congkak is a deterministic, perfect-information, two-player mancala game with lap-sowing on a 16-pit circular track (14 small pits and 2 storehouses). The strategic engine revolves around multi-lap relay cascades, securing bonus storehouse turns, executing cross-board empty-pit captures (*menembak*), and permanently shrinking the opponent's active board state across successive rounds via burnt pits (*terbakar*). ## Formal model - **Abstraction taken:** None required; the traditional game rules constitute a fully discrete, deterministic state machine. - **Player/agent count:** Exactly 2 agents (Player 1 and Player 2). - **Turn model:** Sequential alternating turns [gap-fill: replaces the informal simultaneous opening with alternating single moves to ensure deterministic tree search]. ## Formal rules R1. Track Topology: A 16-element directed cycle C=(0..15). - Player 1 pits: indices 0..6. Player 1 storehouse (*rumah*): index 7. - Player 2 pits: indices 8..14. Player 2 storehouse (*rumah*): index 15. - Opposite pit mapping: For i∈0..6, opposite(i)=14−i. R2. Initial State: For Round 1, pits 0..6 and 8..14 each contain 7 seeds (Si=7). Storehouses S7=0,S15=0. Active pits mask Ai=true for all i∈{0..6,8..14}. R3. Legal Moves: On Player p's turn (p∈{1,2}), the legal action set is {i∈Pits(p)|Ai∧Si>0}. If this set is empty, the turn is skipped. R4. Relay Sowing Engine: - Agent selects pit i. K←Si,Si←0. Current index curr←i. - While K>0: - curr←(curr+1)mod16. - If curr==Storehouse(opponent(p)) or Acurr==false, skip this index without dropping a seed. - Scurr←Scurr+1,K←K−1. - Landing Resolution (when K==0): - Case A (Landing in own Storehouse): If curr==Storehouse(p), the agent receives a bonus turn and immediately selects another non-empty friendly pit. - Case B (Landing in non-empty pit): If Scurr>1 and curr≠Storehouse(p), K←Scurr,Scurr←0, and the sowing loop continues from curr. - Case C (Landing in empty friendly pit / Capture): If Scurr==1 and curr∈Pits(p), check opp=opposite(curr). If Sopp>0∧Aopp, the agent captures Sopp+1 seeds, adding them directly to Storehouse(p), setting Scurr←0,Sopp←0. The turn ends (*mati*). - Case D (Landing in empty enemy pit): If Scurr==1 and curr∈Pits(opponent), the turn ends (*mati*) with no capture. R5. Round Termination & Re-seeding: - When both players have zero legal moves, the round ends. - Each player counts total seeds in their storehouse. Each player refills their pits sequentially with 7 seeds per pit starting from the pit closest to their storehouse. - Any pit that cannot be filled with a full 7 seeds is marked burnt (Ai←false). Leftover seeds are placed back in the storehouse. R6. Win Condition: A player who starts a round with 0 active pits (Ai=false for all friendly pits) loses the match immediately. ## Edge cases - Tie at the end condition: If both players retain equal pits and seeds across 10 rounds, the player with the higher total seed bank wins [gap-fill]. - A player with no legal move: If a player's pits are all empty during a round while the opponent still has seeds, the empty player's turn is skipped until the opponent sows seeds into the player's side or halts. - Repetition / cycles: The finite seed count (98) combined with monotonic capture into non-sown storehouses ensures every round terminates in finite steps. - Simultaneous claims on the same resource or position: Not applicable; turns are strictly sequential. - Player elimination mid-round: Pits become inactive only during round-resetting re-seeding phase. - Resource exhaustion: Seed count is invariant (98 total seeds conserved across all pits and stores). - Termination guarantee: Each capture permanently locks seeds into storehouses, strictly reducing active track seeds until 0 remain in pits. ## State representation - Persistent state: - `seeds`: array of 16 integers (0..98). - `active_mask`: array of 16 booleans. - `active_player`: integer ∈{1,2}. - `round_number`: integer. - Observable information: Perfect information, fully observed by both agents. ## Action space - `sow_pit(pit_index)`: - `pit_index` ∈{0..6} for Player 1; ∈{8..14} for Player 2. Precondition: Apit==true∧Spit>0. ## Playability notes - Single-player-vs-AI: Ideal; perfectly suited for alpha-beta pruning, Negamax, or MCTS with zero adaptation required. - Group games (n>4): Inherently a 2-player game; tournaments run as elimination brackets. - Physical-skill games: Not applicable; fully intellectual abstract strategy. - What is lost: Physical sound and tactile cadence of rhythmic cowrie shell drops against hollowed wood. ## Implementation hints Branching factor is small (b≤7). State is easily bit-packed into a 64-bit integer or short vector. Sowing loop with multi-lap continuation is the only non-trivial component.

Download as JSON

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

Download JSON
Cite this page

Malay Mancala (Singapore). (n.d.). Games of Countries. https://gamesofcountries.com/games/sg-singapore/congkak

@misc{gamesofcountries-sg-singapore-congkak,
  title = {Malay Mancala (Singapore)},
  year = {n.d.},
  publisher = {Games of Countries},
  url = {https://gamesofcountries.com/games/sg-singapore/congkak}
}