Formal Specification
The Five-Cowrie Game — Formal Specification
Sri Lanka · board-race · Confidence: high
← Back to game pageImplementation Suitability
Suitability: engine-readyFidelity: directGap-fills: 3
# Pancha Keliya — AI-optimized specification
## General idea
Pancha Keliya (The Five-Cowrie Game) is a traditional Sri Lankan race board game. Two opposing sides cast six marine cowrie shells from a half-coconut shell cup to race three playing pieces (*ittan*) along a looped circuit with cross-marked safety squares (*gēval*), capturing and resetting opponent markers, and maneuvering all three pieces into the central home reservoir (*jala*).
## Formal model
- **Abstraction taken:** Direct discrete formalization. Race track is modeled as a 1D coordinate graph of `L = 36` track cells with marked safety vertices `Safe_Nodes = {0, 4, 9, 14, 19, 24, 29, 34}` and a terminal home goal `JALA`. The 6 cowrie shells are modeled as 6 independent Bernoulli trials `Bernoulli(p = 0.5)` where mouth-up is success.
- **Player/agent count:** 2 players (Player 0 and Player 1) or 2 teams.
- **Turn model:** Sequential turns with consecutive bonus rolls on qualifying results.
## Formal rules
R1. Setup:
- Each player begins with 3 pieces in hand off-board (`OffBoard = [Piece_1, Piece_2, Piece_3]`).
- Track coordinates `0..35` and goal `JALA`.
- Goal count: `Home[0] = 0`, `Home[1] = 0`.
R2. Cowrie Cast & Valuation:
- On a turn, the active player casts 6 cowrie shells.
- Let `k in {0..6}` be the count of cowries landing mouth up.
- Point value and bonus roll rules:
- `k = 1` (*Onduwa*): 1 point + Extra Roll. (Entry qualifier).
- `k = 2` (*Dēva*): 2 points.
- `k = 3` (*Thuna*): 3 points.
- `k = 4` (*Hathara*): 4 points.
- `k = 5` (*Pancha*): 5 points + Extra Roll. (Entry qualifier).
- `k = 6` (*Sirimala*): 6 points + Extra Roll.
- `k = 0` (*Bokka / Dolaha*): 12 points + Extra Roll. (Entry qualifier).
- If a bonus roll is earned, the score is added to a turn movement pool `Turn_Pool`, and the player rolls again. Rolling stops when a non-bonus value (2, 3, or 4) is cast.
R3. Board Entry (*Kotuwa Dæmeema*):
- A piece in `OffBoard` can only enter cell `0` by consuming an entry-qualifying score (*Onduwa* = 1, *Pancha* = 5, or *Bokka* = 12) from `Turn_Pool`.
- Entering consumes the exact qualifying score value (e.g. consuming a 5-point *Pancha* places the piece on starting cell 0 and expends the 5 points; [gap-fill] or advances the piece 5 steps from cell 0).
R4. Piece Movement & Safety:
- Points from `Turn_Pool` are allocated to move active pieces along the track.
- If a piece lands on a safe square `s in Safe_Nodes`, it is completely immune to capture. Multiple pieces (friendly and enemy) may occupy a safe square simultaneously.
R5. Capture (*Käpeema*):
- If a piece lands by exact count on an un-crossed, non-safe square occupied by an enemy piece:
- The enemy piece is captured ("cut") and returned to the opponent's `OffBoard` pool.
- [gap-fill] Capturing an enemy piece awards 1 additional bonus roll to the active player.
R6. Reaching Goal (*Goda Baseema / Jala*):
- To enter the central goal (*jala*), a piece must reach the terminal track cell and enter by an exact roll of 1 (*Onduwa*).
- Once in `JALA`, the piece is permanently scored and retired (`Home[active] += 1`).
R7. Win Condition:
- The first player to retire all 3 pieces into `JALA` (`Home[active] == 3`) wins immediately.
## Edge cases
- Tie at the end condition: Not applicable — race terminates the moment a player enters their 3rd piece into `JALA`.
- A player with no legal move: If no pieces can legally use the points in `Turn_Pool`, the points are forfeited and turn passes to opponent.
- Repetition / cycles: While pieces can be captured and reset, progress into `JALA` is permanent and absorbing. [gap-fill] Move cap of 200 turns prevents infinite loops.
- Simultaneous claims on the same resource: Multiple pieces can occupy safety squares (`Safe_Nodes`). On non-safe squares, landing initiates capture.
- Player elimination mid-round: Not applicable — 2-player race.
- Resource exhaustion: Pieces are conserved (3 per side); cowries are rolled repeatedly.
- Termination guarantee: `Home_count` monotonically increases toward 3, and stochastic drift guarantees pieces eventually enter `JALA`.
## State representation
- Persistent state:
- `piece_positions` (mapping of 6 pieces to track coordinates `0..35`, `OFF_BOARD`, or `JALA`).
- `home_counts` (2-element array `[Home_0, Home_1]`).
- `active_player` (0 or 1).
- `turn_counter` (integer).
- Per-turn ephemeral state:
- `turn_movement_pool` (list of integers available to spend).
- `consecutive_bonus_rolls` (integer).
- Observable information: Fully observable — all piece locations, dice roll values, and scores are public.
## Action space
- `cast_cowries()`:
- Trigger stochastic roll of 6 cowrie shells.
- `enter_piece(piece_id, roll_value)`:
- Deploy piece from `OFF_BOARD` to track using qualifying score.
- `move_piece(piece_id, distance)`:
- Advance active on-board piece by `distance` from movement pool.
## Playability notes
- Single-player-vs-AI: Engine-ready stochastic race game. AI uses Expectimax or Monte Carlo Tree Search (MCTS) to optimize risk-reward between racing forward, capturing opponents, and taking refuge on safety squares.
- Group games (n>4): Extends to 2 teams of 4 players alternating dice casts.
- Physical-skill games: Purely discrete board race around a binomial cowrie randomizer.
- What is lost in the adaptation: The resonant hollow thud of the coconut cup striking the woven rush mat and celebratory shouts of *"Onduwai!"*.
## Implementation hints
Low complexity. Board is a 36-node track with safe flags. The 6-cowrie probability distribution has 7 outcomes with exact combinatorial weights: `C(6, k) / 64`. Milestone 1: implement cowrie sampler, movement pool allocator, capture logic, and goal exit in under 150 lines.
Download as JSON
Download the full game corpus entry for this game as structured JSON.
Download JSONCite this page
The Five-Cowrie Game (Sri Lanka). (n.d.). Games of Countries. https://gamesofcountries.com/games/lk-sri-lanka/pancha-keliya
@misc{gamesofcountries-lk-sri-lanka-pancha-keliya,
title = {The Five-Cowrie Game (Sri Lanka)},
year = {n.d.},
publisher = {Games of Countries},
url = {https://gamesofcountries.com/games/lk-sri-lanka/pancha-keliya}
}