Skip to main content
Formal Specification

Walnut Game — Formal Specification

Bulgaria · gambling-stake · Confidence: medium

← Back to game page

Implementation Suitability

Suitability: engine-readyFidelity: probabilistic-proxyGap-fills: 3
# Igra na orehi — AI-optimized specification ## General idea A turn-based spatial staking and target-collision game. Players contribute physical walnut tokens into a bounded 2D target circle and execute continuous force/angle shots using a designated shooter token to disperse the cluster across boundary perimeters. Successful extractions grant token ownership and immediate turn extensions. ## Formal model - **Abstraction taken:** The 2D physical collision of irregular spheroids (walnuts) is abstracted into a 2D elastic collision model with radial scatter vectors parameterized by shot accuracy, projectile mass, and cluster density. - **Player/agent count:** K players (K∈[2,8]). - **Turn model:** Sequential turn rotation with conditional continuation on successful capture. ## Formal rules R1. Setup: - Target circle has center (0,Ydist) with radius Rtarget=0.5 metres (Ydist=4.0 m). Baseline is at y=0. - Each player stakes S walnuts (S≥1). Total pot M=K×S walnuts are placed inside the circle in a clustered configuration. R2. Turn Order: - Each player submits a distance calibration throw toward baseline y=0. Player with minimum landing error shoots first, followed in ascending order of error. R3. Shooting Action: - Active player submits shot vector 𝐯=(θ,F) from current shooter position 𝐩shooter (initial throw from baseline (0,0)). - [gap-fill] Shooter trajectory ends at 𝐩impact=𝐩shooter+(Fsin⁡θ,Fcos⁡θ)+𝒩(0,σaim2). R4. Collision and Scatter Resolution: - For each remaining walnut wj in the circle, if ||𝐩impact−𝐩wj||≤rcollision, walnut wj receives impulse Δ𝐩wj=𝐯scatter. - New position: 𝐩wj′=𝐩wj+Δ𝐩wj. - Extraction check: If ||𝐩wj′−(0,Ydist)||>Rtarget, walnut wj has exited the circle and is captured by the active player (added to player's bank Bi). R5. Turn Continuation: - If count of captured walnuts in current shot C≥1: - Active player collects captured nuts. - Active player retains turn and shoots next shot from current resting position 𝐩impact (or from baseline if 𝐩impact exited the arena). - If C==0: Turn ends immediately; turn passes to next player in sequence (current_player+1)(modK). R6. [gap-fill] Turn Runout Cap: An active player may execute at most 5 consecutive shots in a single turn to ensure fair rotation among all participants. R7. Victory Condition: - Game terminates immediately when all M staked walnuts have been cleared from the target circle (Mremaining==0). - The player with the highest accumulated walnut count Bi wins the pot. R8. [gap-fill] Tiebreaker: If multiple players tie for most captured walnuts, tied players execute one sudden-death shot at a single target nut; closest displacement wins. ## Edge cases - Tie at the end condition: Resolved by R8 sudden-death target throw. - A player with no legal move: Not applicable — shooting action is always available while walnuts remain in the pot. - Repetition / cycles: Bounded: The number of remaining target walnuts M is strictly non-increasing and monotonically decrements toward 0; each shot with 0 captures forces a turn pass. - Simultaneous claims on the same resource or position: Turns are strictly sequential; exact token IDs are tracked and removed from the active circle upon capture. - Player elimination mid-round; turn order repair: If a player disconnects, their bank Bi remains fixed; turn skips disconnected player ID in sequence. - Resource exhaustion: Target pot M decrements to exactly 0, triggering game termination R7. - Termination guarantee: Enforced by finite pot M, mandatory turn pass on miss (R5), and runout cap (R6). ## State representation - Persistent state: Player bank counts [B1,…,BK], active player index c∈[0,K−1], shooter coordinates. - Per-turn ephemeral state: Array of remaining walnut positions [(x1,y1),…,(xm,ym)], consecutive hit counter, current shot vector. - Observable information: Fully observable — all token positions, boundaries, and player bank totals are public knowledge. ## Action space - `shoot_cluster(angle, force)`: Precondition: Caller is active player, pot has remaining walnuts (m>0). ## Playability notes - Single-player-vs-AI: Natural — Human plays vs 1..7 AI agents with parameterized physical shot accuracy and aim selection logic. - Group games (n>4): Fully scalable; rotation order seamlessly supports up to 8 players. - Physical-skill games: Accuracy modeled via 2D normal distribution with variance determined by agent `accuracy` attribute; collision impulse modeled via basic 2D elastic vector mathematics. - What is lost: The tactile surface friction of cobblestones vs dirt and the distinct shell weight of individual walnuts are abstracted into uniform physics parameters. ## Implementation hints Low complexity. The 2D collision resolution can be implemented with simple radial impulse vectors pushing nearby points outward from the impact center. Suggested first milestone: implement the circle extraction check and verify that random shots reliably clear the pot within a bounded number of turns.

Download as JSON

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

Download JSON
Cite this page

Walnut Game (Bulgaria). (n.d.). Games of Countries. https://gamesofcountries.com/games/bg-bulgaria/igra-na-orehi

@misc{gamesofcountries-bg-bulgaria-igra-na-orehi,
  title = {Walnut Game (Bulgaria)},
  year = {n.d.},
  publisher = {Games of Countries},
  url = {https://gamesofcountries.com/games/bg-bulgaria/igra-na-orehi}
}