Formal Specification
The Cap Game — Formal Specification
Kosovo · guessing-hidden · Confidence: low
← Back to game pageImplementation Suitability
Suitability: engine-readyFidelity: directGap-fills: 3
# Loja e kapuçave — AI-optimized specification
## General idea
A discrete, imperfect-information asymmetric bluffing game played across successive rounds between a Hiding agent and a Searching agent. The Hider secretly places a single token under one of 10 available caps; the Searcher attempts either to uncover the token immediately on attempt 1 (high reward) or systematically eliminate empty caps to isolate it on attempt 10 (low reward). Prematurely revealing the token on intermediate attempts awards the Hider points proportional to the number of remaining uninspected caps.
## Formal model
- **Abstraction taken:** Multi-player team deliberation is formalized as a single decision-maker per team (Team Captain). The psychological body language interaction is represented directly through hidden state selection and sequential reveal actions.
- **Player/agent count:** 2 opposing agents: Team A and Team B (alternating Hider and Searcher roles).
- **Turn model:** Two phases per round:
1. *Hiding phase:* Hider submits a secret index .
2. *Searching phase:* Searcher submits sequential selection actions until a termination condition is reached.
## Formal rules
R1. **Initial State:** Target score . Running scores , . Starting Hider chosen uniformly at random [gap-fill].
R2. **Round Setup:** Caps set . Attempt counter .
R3. **Hiding Action:** The active Hider secretly selects token index . This selection is masked from the Searcher's observation set.
R4. **Searcher Decision Loop:** On attempt , the active Searcher selects cap .
R5. **Searcher Attempt Resolution:**
- If and : Searcher succeeds immediately. Searcher team gains points. The Searcher becomes the Hider for the next round. Round terminates.
- If and : Cap is removed from (). Increment attempt counter . Searcher continues to the next attempt.
- If and : Searcher fails prematurely. Hider team gains points equal to (the number of untouched caps, including the revealed cap). Hider retains the hiding role for the next round. Round terminates.
- If and : Searcher has successfully cleared all 9 empty caps. Searcher team gains point. Searcher becomes the Hider for the next round. Round terminates.
R6. **Fault Condition:** [gap-fill] If a Hider submits an invalid index (), the turn automatically passes to the Searcher with penalty points awarded to the Searcher.
R7. **Match Termination:** As soon as any team reaches or exceeds at the conclusion of a round, the match ends immediately and that team is declared the winner.
## Edge cases
- **Tie at the end condition:** If both teams exceed 100 points simultaneously (not possible under standard sequential scoring, but applicable if penalty points apply), the team with the higher absolute score wins. If strictly equal, [gap-fill] sudden-death rounds are played until one team leads at round completion.
- **A player with no legal move:** Not applicable; on every turn in the hiding phase the Hider chooses from 10 slots, and on every turn in the search phase the Searcher chooses from the non-empty set of remaining caps .
- **Repetition / cycles:** Impossible within a round because each search step strictly decrements by 1, bounding a round to at most 10 steps. Across rounds, points are strictly non-negative and strictly positive points are awarded in every non-null outcome, guaranteeing convergence toward 100.
- **Simultaneous claims on the same resource or position:** Not applicable; phase order is strictly sequential (Hiding action commits before Searching actions begin).
- **Player elimination mid-round / turn order repair:** Not applicable; 2-agent game with fixed role alternation.
- **Resource exhaustion:** Caps set is fully reset to at the start of every round.
- **Termination guarantee:** Each round awards a minimum of 1 point (on full Searcher clear) or between 2 and 9 points (on Hider win) or 10 points (on first-attempt find). Since points monotonically increase in every round, the game provably terminates in at most 100 rounds.
## State representation
- **Persistent state:**
- `score_A`: integer
- `score_B`: integer
- `hider_role`: enum
- **Per-round ephemeral state:**
- `h_secret`: integer (hidden from Searcher)
- `available_caps`: bitset of size 10 (public)
- `attempt_k`: integer (public)
- `round_history`: list of revealed caps and outcomes
- **Observable information:**
- Hider observes: `score_A`, `score_B`, `hider_role`, `h_secret`, `available_caps`, `attempt_k`, `round_history`.
- Searcher observes: `score_A`, `score_B`, `hider_role`, `available_caps`, `attempt_k`, `round_history` (`h_secret` is masked).
## Action space
- `hide(cap_id)`: parameter `cap_id` . Precondition: game in `HIDING_PHASE`.
- `reveal(cap_id)`: parameter `cap_id` . Precondition: game in `SEARCHING_PHASE`.
## Playability notes
- **Single-player-vs-AI:** Highly natural. An AI Hider can employ mixed-strategy Nash equilibrium distributions over cap positions, while an AI Searcher can model opponent frequency biases.
- **Group games (n>4):** Multi-agent team deliberation reduces directly to 2 decision agents without altering game mechanics, as team members in traditional play pool information to reach a single consensus pick.
- **Physical-skill games:** Not applicable; purely strategic imperfect-information game.
- **What is lost in the adaptation:** The rich physical theater of the *oda*—micro-expressions, vocal intimidation, laughter, and satirical celebratory songs—is abstracted into pure information theory.
## Implementation hints
- State space is small and discrete: game tree depth per round is at most 10, branching factor starts at 10 and decreases by 1 each step.
- Optimal Searcher policy on round : choose between attempting a 1st-try guess (probability , reward ) vs playing safe to uncover empty caps.
- First milestone: Implement single-round state machine with interactive CLI for human vs random/minimax bot, then add the 100-point match accumulator.
Download as JSON
Download the full game corpus entry for this game as structured JSON.
Download JSONCite this page
The Cap Game (Kosovo). (n.d.). Games of Countries. https://gamesofcountries.com/games/xk-kosovo/loja-e-kapucave
@misc{gamesofcountries-xk-kosovo-loja-e-kapucave,
title = {The Cap Game (Kosovo)},
year = {n.d.},
publisher = {Games of Countries},
url = {https://gamesofcountries.com/games/xk-kosovo/loja-e-kapucave}
}