Skip to main content
Formal Specification

Malaysian Mancala — Formal Specification

Malaysia · board-abstract · Confidence: low

← Back to game page

Implementation Suitability

Suitability: engine-readyFidelity: directGap-fills: 2
# Congkak — AI-optimized specification ## General idea A two-player discrete combinatorial mancala game played on a 2x7 pit board with two dedicated storehouse pits. Players execute multi-lap relay sowing, where turns dynamically extend by landing in populated pits or home storehouses, and cross-board captures occur upon terminating in empty home pits opposite populated enemy pits. The game is completely deterministic given opening choices, making it directly suited for game tree search and reinforcement learning. ## Formal model - **Abstraction taken:** None; the physical board topology and seed counts are inherently discrete and deterministic. Sowing velocity and simultaneous start collisions are formalized into sequential discrete turns with alternating first-mover advantage across rounds. - **Player/agent count:** 2 agents (designated Player 0 and Player 1). - **Turn model:** Sequential turns. [gap-fill] For the opening move of Round 1, Player 0 moves first (replacing physical real-time simultaneous grabbing to guarantee deterministic game-state tracking). ## Formal rules R1. State representation: The board is an array `pits[16]`. Indices 0–6 are Player 0's *kampung*; index 7 is Player 0's *rumah*. Indices 8–14 are Player 1's *kampung*; index 15 is Player 1's *rumah*. R2. Initial setup: For round 1, `pits[i] = 7` for all `i in [0..6]` and `i in [8..14]`; `pits[7] = 0` and `pits[15] = 0`. R3. Legal actions: On Player P's turn, legal actions are picking a non-empty, non-burnt pit k from P's own side (k∈[0..6] if P=0; k∈[8..14] if P=1). If all home pits are empty or burnt, the player must pass. R4. Sowing mechanics: Let n=pits[k], and set pits[k]=0. In counterclockwise order (incrementing index modulo 16), deposit 1 seed per pit, strictly skipping the opponent's *rumah* (index 15 for P0, index 7 for P1) and skipping any burnt pit (seeds that would enter a burnt pit go directly to P's *rumah*). R5. Turn resolution: - If the final seed drops into P's *rumah*, P retains the turn and immediately selects another legal action from their own pits. - If the final seed drops into a non-empty, non-burnt pit, scoop all seeds from that pit and continue sowing immediately. - If the final seed drops into an empty pit on the opponent's side, P's turn ends. - If the final seed drops into an empty pit k on P's side: - Let opposite pit opp=14−k. If pits[opp]>0 and opp is not burnt, P captures pits[opp]+1 seeds, adds them to P's *rumah*, and sets pits[k]=0, pits[opp]=0. P's turn ends. - If pits[opp]==0 or opp is burnt, no capture occurs; P's turn ends. R6. Round end & Pit burning: When all seeds on the board are in the two *rumah* pits, the round ends. Each player refills their 7 pits from left-to-right using seeds from their *rumah* (7 per pit). Any pit unable to receive 7 full seeds is marked burnt. Leftover seeds remain in the *rumah*. R7. [gap-fill] Loop breaking rule: If a single player's sowing sequence exceeds 200 consecutive laps without landing in an empty pit or *rumah*, the current sowing is terminated and the carried seeds are placed directly into the player's *rumah*. R8. Win condition: The game terminates when one player has 0 active (unburnt) pits at round setup. The player with the higher total seed count in their *rumah* wins. ## Edge cases - Tie at the end condition: If both players hold exactly 49 seeds at final scoring, the game is declared a draw. - A player with no legal move: If all of an active player's pits contain 0 seeds during a turn, the turn passes to the opponent. - Repetition / cycles: Bounded by the finite seed count per sowing cycle and the 200-lap circuit breaker in R7. - Simultaneous claims on the same resource: Not applicable; turns are sequential. - Player elimination mid-round: If a player runs out of seeds mid-round, the remaining player plays solo until their own moves naturally expire (*mati*). - Resource exhaustion: Total seed count is conserved at 98 across all rounds. - Termination guarantee: At the end of each round, total seeds are redistributed in multiples of 7; uneven counts progressively burn pits, monotonically reducing the board size until termination is reached. ## State representation - Persistent state: `pits[16]` (integer array 0..98), `burnt[14]` (boolean array), `round_number` (integer), `active_player` (0 or 1). - Per-turn ephemeral state: `hand` (seeds currently in motion), `current_index` (current sowing cursor). - Observable information: Fully observable by both agents (perfect information). ## Action space - `sow(pit_index)`: Integer k∈[0..6] (for Player 0) or k∈[8..14] (for Player 1), where pits[k]>0 and burnt[k]==false. ## Playability notes - Single-player-vs-AI: Engine-ready; standard minimax with alpha-beta pruning or MCTS applies directly without modification. - Group games (n>4): Not applicable; Congkak is strictly a 2-agent duel. - Physical-skill games: Not applicable; pure deterministic strategy. - What is lost: The physical tactile rhythm of rapid single-handed sowing is abstracted into an instantaneous state transition. ## Implementation hints Branching factor is small (≤7 at any decision node), but tree depth within a single turn can be long due to chained sowing. Representing the board as a 16-element integer vector allows lightning-fast bitwise or array evaluations. First milestone: implement a single-round engine with standard *menembak* capture rules.

Download as JSON

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

Download JSON
Cite this page

Malaysian Mancala (Malaysia). (n.d.). Games of Countries. https://gamesofcountries.com/games/my-malaysia/congkak

@misc{gamesofcountries-my-malaysia-congkak,
  title = {Malaysian Mancala (Malaysia)},
  year = {n.d.},
  publisher = {Games of Countries},
  url = {https://gamesofcountries.com/games/my-malaysia/congkak}
}