Formal Specification
Malay Mancala — Formal Specification
Singapore · board-abstract · Confidence: high
← Back to game pageImplementation 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 .
- Player 1 pits: indices . Player 1 storehouse (*rumah*): index 7.
- Player 2 pits: indices . Player 2 storehouse (*rumah*): index 15.
- Opposite pit mapping: For , .
R2. Initial State: For Round 1, pits and each contain 7 seeds (). Storehouses . Active pits mask for all .
R3. Legal Moves: On Player 's turn (), the legal action set is . If this set is empty, the turn is skipped.
R4. Relay Sowing Engine:
- Agent selects pit . . Current index .
- While :
- .
- If or , skip this index without dropping a seed.
- .
- Landing Resolution (when ):
- Case A (Landing in own Storehouse): If , the agent receives a bonus turn and immediately selects another non-empty friendly pit.
- Case B (Landing in non-empty pit): If and , , and the sowing loop continues from .
- Case C (Landing in empty friendly pit / Capture): If and , check . If , the agent captures seeds, adding them directly to , setting . The turn ends (*mati*).
- Case D (Landing in empty enemy pit): If and , 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 (). Leftover seeds are placed back in the storehouse.
R6. Win Condition: A player who starts a round with 0 active pits ( 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 ().
- `active_mask`: array of 16 booleans.
- `active_player`: integer .
- `round_number`: integer.
- Observable information: Perfect information, fully observed by both agents.
## Action space
- `sow_pit(pit_index)`:
- `pit_index` for Player 1; for Player 2. Precondition: .
## 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 (). 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 JSONCite 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}
}