Formal Specification
Coin Pitching — Formal Specification
Serbia · dexterity-throw · Confidence: low
← Back to game pageImplementation Suitability
Suitability: engine-readyFidelity: probabilistic-proxyGap-fills: 3
# Krajcarice — AI-optimized specification
## General idea
A two-phase precision pitching and probability harvesting game. In Phase 1, agents pitch a coin toward a 1D target line (the wall); proximity establishes a priority turn queue. In Phase 2, agents in queue order flip the uncollected pot of fair coins, calling heads or tails and claiming matching coins until the pot is empty.
## Formal model
- **Abstraction taken:** The physical bounce, spin, and friction of a coin pitch are replaced by a continuous distance generator `dist_i = |target_dist - f(force, angle, skill_i)| + Noise`. The coin toss in Phase 2 is modeled as independent fair Bernoulli trials `Bernoulli(0.5)`.
- **Player/agent count:** `N` agents (`N in 2..6`, default `N = 2`).
- **Turn model:** Sequential pitching in Phase 1; prioritized sequential harvesting in Phase 2.
## Formal rules
R1. Ante Setup: Each agent deposits 1 token/coin into the shared pot `Pot = N`. Each agent's bankroll is tracked as `bankroll[i]`.
R2. Phase 1 (Pitching):
- Each agent `i in [0..N-1]` selects throwing parameter `effort in [0.0, 1.0]`.
- Landing distance to wall `d_i = abs(effort - optimal_effort) * max_dist + Normal(0, sigma_pitch)`.
- Agents are sorted in ascending order of `d_i` to form priority queue `Q = [q_1, q_2, ..., q_N]`.
R3. Phase 2 (Harvesting):
- Set `remaining_pot = Pot`.
- For each agent `q in Q`:
- If `remaining_pot == 0`, break.
- Agent `q` selects call `C in {Heads, Tails}`.
- The simulator rolls `remaining_pot` fair binary coins.
- The count of coins matching `C` is `k_won`.
- Agent `q` receives `k_won` coins: `bankroll[q] += k_won`.
- Update: `remaining_pot -= k_won`.
R4. [gap-fill] Residue Resolution: If any coins remain after the last agent in `Q` has tossed, all remaining coins are automatically awarded to the 1st-ranked agent `q_1`.
R5. [gap-fill] Match Structure: A match consists of `R` rounds (default `R = 10`). The agent with the highest final `bankroll` wins.
## Edge cases
- Tie at the end condition: In Phase 1 distance ties, the agent who pitched earlier in that round's sequence takes the higher priority in `Q`. If match bankrolls tie at round `R`, a 1-round sudden death pitch-off is executed.
- A player with no legal move: Not applicable; pitch force `[0.0, 1.0]` and coin calls `{Heads, Tails}` are always available.
- Repetition / cycles: Bounded; each round completes in at most `N` flips; match completes in exactly `R` rounds.
- Simultaneous claims on the same resource or position: Resolved strictly by queue order `Q`.
- Player elimination mid-round / turn order repair: [gap-fill] If an agent's bankroll reaches 0 before round `R`, they are eliminated, and remaining rounds proceed with `N-1` agents.
- Resource exhaustion: The pot is strictly non-negative and depletes monotonically each turn.
- Termination guarantee: Guaranteed by finite round count `R` and finite Bernoulli trials.
## State representation
- Persistent state: `bankrolls: dict[AgentID, int]`, `round: int`, `max_rounds: int`.
- Per-round ephemeral state: `pot: int`, `distances: dict[AgentID, float]`, `priority_queue: list[AgentID]`, `remaining_pot: int`.
- Observable information: Fully observable public state.
## Action space
- `pitch(effort: float)`: Continuous parameter `[0.0, 1.0]`.
- `call_side(side: enum[Heads, Tails])`: Discrete call before coin toss.
## Playability notes
- Single-player-vs-AI: Natural; AI optimizes pitch consistency and leverages binomial expectation to calculate expected earnings per rank.
- Group games (n>4): Scales naturally; with larger `N`, the 1st-ranked pitcher's expected harvest fraction is .
- Physical-skill games: Motor precision parameterized via `sigma_pitch`.
- What is lost in the adaptation: The tactile feel of bouncing coins off mortar joints and skimming across uneven asphalt is replaced by a distance distribution.
## Implementation hints
Extremely simple to implement. State machine contains 2 discrete phases. First milestone: implement 2-agent round with analytical binomial distributions and verify conservation of tokens ( total tokens).
Download as JSON
Download the full game corpus entry for this game as structured JSON.
Download JSONCite this page
Coin Pitching (Serbia). (n.d.). Games of Countries. https://gamesofcountries.com/games/rs-serbia/krajcarice
@misc{gamesofcountries-rs-serbia-krajcarice,
title = {Coin Pitching (Serbia)},
year = {n.d.},
publisher = {Games of Countries},
url = {https://gamesofcountries.com/games/rs-serbia/krajcarice}
}