Formal Specification
Five Stones — Formal Specification
Israel · dexterity-small · Confidence: high
← Back to game pageImplementation Suitability
Suitability: adaptation-requiredFidelity: probabilistic-proxyGap-fills: 4
# Chamesh Avanim — AI-optimized specification
## General idea
Chamesh Avanim is a sequential, level-based dexterity game where players perform multi-action manual tasks: throwing a piece, scooping a specific subset of lying pieces, and catching the thrown piece with the same hand. The strategic element revolves around managing risk (e.g., how widely to cast the stones) and technical precision, while the physical execution is modeled stochastically.
## Formal model
- **Abstraction taken:** The continuous physical acts of tossing, sweeping, and catching are collapsed into discrete stochastic resolution steps. [gap-fill] The probability of a successful catch is determined by a function of: the current stage (increasing difficulty 1 to 5), the physical distance between target stones on the floor, and a persistent "skill" scalar of the active agent.
- **Player/agent count:** 1 to n players. Players execute their turns fully sequentially.
- **Turn model:** Strictly sequential. A player remains the "active agent" as long as they succeed. On a fault, the turn passes to the next player.
## Formal rules
R1. **Setup:** On their turn, the active player casts 5 stones. [gap-fill] The cast is represented by a set of five 2D coordinates in a square, sampled from a spatial distribution.
R2. **Turns & Stages:** A player's career state is represented by `(stage_index, attempt_index)`. The stages are:
- Stage 1: 4 turns of tossing 1, picking up 1, catching.
- Stage 2: 2 turns of tossing 1, picking up 2, catching.
- Stage 3: 2 turns (one picking up 1, one picking up 3).
- Stage 4: Toss 1, place 4 down, catch; then toss 1, pick up 4, catch.
- Stage 5 (The Gate): Place non-dominant hand at coordinate to form a gate. Perform 4 tosses, sliding one stone through the gate on each, then a final toss sweeping all 4 through and catching.
R3. **Leader Selection:** [gap-fill] In Stage 5, the opponent agent selects which of the 4 floor stones is the "leader" (which must be flicked through last). If playing single-player, this stone is chosen at random.
R4. **Actions:** The active agent selects a throwing stone and target stone(s) to pick up.
R5. **Stochastic Resolution:**
- For each step, the action `attempt_catch(throwing_stone, target_stones)` is resolved:
- If successful, the state updates (stones collected). If all steps in a stage are completed, the player immediately advances to `stage_index + 1`.
- If failed (fault), the player's turn terminates immediately, and their state is saved at the beginning of `stage_index`.
R6. **Win Condition:** The first player to complete Stage 5 wins. If a player completes Stage 5, the round ends, and they are declared the winner.
## Edge cases
- **Tie at the end condition:** Not applicable; turns are fully sequential. The first player to complete Stage 5 wins immediately.
- **A player with no legal move:** Not applicable; casting stones always provides legal target coordinates.
- **Repetition / cycles:** Because players cannot regress below their current saved stage and each throw has a non-zero probability of failure (passing the turn) and success (advancing), the game is guaranteed to progress and eventually terminate.
- **Simultaneous claims on the same resource:** Not applicable; players play on fully separate turns.
- **Player elimination mid-round:** If an agent is eliminated or drops out, they are removed from the sequence, and the remaining turn rotation is repaired seamlessly.
- **Resource exhaustion:** Not applicable; the 5 stones are persistent and never consumed.
- **Termination guarantee:** Guaranteed stochastically as long as the success probability is bounded away from 0 ().
## State representation
- **Persistent state:**
- `active_player_id`: Index of the current player.
- `player_states`: Map of `player_id` to `(stage_index, completed_sub_steps)`.
- **Per-turn ephemeral state:**
- `stone_positions`: Array of five 2D coordinates `(x, y)` representing the cast layout.
- `collected_stones`: Array of booleans representing which stones are currently held in the hand.
- `throwing_stone_index`: Index of the currently active tossing stone.
- `leader_stone_index`: Index of the designated leader stone in Stage 5.
## Action space
- `cast_stones()`: Computes new spatial layout for the 5 stones on a new stage attempt.
- `select_throwing_stone(index)`: Selects which stone to hold and throw.
- `attempt_catch(target_indices)`: Executes a step, resolving stochastically. Parameters are the indices of the stones on the floor to pick up.
## Playability notes
- **Single-player-vs-AI:** Highly playable. The human player competes against an AI agent whose "skill" parameter is adjusted to match the human's average physical success rate.
- **Group games (n>4):** Scales cleanly without structural change since play is strictly sequential.
- **Physical-skill games:** [gap-fill] The physical challenge is simulated using a mathematical model where the distance between the target stones and the throwing stone's landing coordinates increases the failure rate.
- **What is lost in the adaptation:** The sensory-motor learning curve (e.g., finger-sliding pressure, precise wrist flicking, eye-hand tracking speed) is lost; only the risk management (deciding which order to pick up scattered stones) and the clean probabilistic progression remain.
## Implementation hints
- Start by implementing the sequential state machine for Stages 1 to 4 with a dummy success rate ().
- Implement Stage 5 (The Gate) with a dedicated state representation for the "gate" coordinates and the sequential flicking of stones.
- Finally, replace the placeholder success rate with a distance-based and skill-based probability formula.
Download as JSON
Download the full game corpus entry for this game as structured JSON.
Download JSONCite this page
Five Stones (Israel). (n.d.). Games of Countries. https://gamesofcountries.com/games/il-israel/chamesh-avanim
@misc{gamesofcountries-il-israel-chamesh-avanim,
title = {Five Stones (Israel)},
year = {n.d.},
publisher = {Games of Countries},
url = {https://gamesofcountries.com/games/il-israel/chamesh-avanim}
}