Skip to main content
Formal Specification

Seven Stones — Formal Specification

Afghanistan · ball-team · Confidence: low

← Back to game page

Implementation Suitability

Suitability: adaptation-requiredFidelity: discretizedGap-fills: 4
# Haft Sang — AI-optimized specification ## General idea A team-based ball-tag and construction game. The attacking team attempts to topple a central tower of seven graduated flat stones with a thrown ball, scatter to evade defending taggers, and collaborate to restack the stones in ascending order, while the defending team passes the ball between players (without running while holding it) to strike and eliminate all attackers before the tower is rebuilt. ## Formal model - **Abstraction taken:** Continuous 2D field movement, ball passing trajectories, and manual stone restacking are discretized into a 2D zone grid (X∈[0,6],Y∈[0,6]) where zone `(3, 3)` contains the stone tower. Continuous sprinting and dodging are modeled via discrete movement points per tick, and restacking requires an agent to remain stationary inside the central zone for consecutive action ticks. - **Player/agent count:** 2 teams (Attacking Team A and Defending Team D), 4 to 6 agents each. - **Turn model:** Phase 1: Sequential opening ball throws by attackers. Phase 2: Simultaneous-tick real-time simulation (max 60 ticks per round). [gap-fill: Phase 2 capped at 60 ticks]. ## Formal rules R1. **Setup & Attributes:** The stone tower at `(3, 3)` has `stones_standing = 7`, `stones_restacked = 0`. All M attacking agents start at baseline `(3, 0)`; defending agents start dispersed in outfield zones `(x, y)` with y≥3. R2. **Phase 1 — Opening Throws:** - Attacking agents take sequential turns throwing the ball from `(3, 0)` at the tower at `(3, 3)`. - Hit probability: P(topple)=0.70. - If an attacker misses and a defender catches the ball on the fly, that thrower is out. - If all attackers exhaust their throws without toppling the tower, the round ends with 0 points, and teams swap roles immediately. - As soon as one throw connects, the tower topples (`stones_standing = 0`), the ball lands at a random outfield zone, and Phase 2 begins. R3. **Phase 2 — Simultaneous Movement & Actions:** - **Attacking Agents:** May execute `MOVE(dx, dy)` (speed: 1 zone/tick) or `RESTACK_STONE()` (valid only while inside zone `(3, 3)`). - **Defending Agents:** May execute `MOVE(dx, dy)` (valid only if NOT holding the ball), `PASS_BALL(target_defender)`, or `THROW_TAG(target_attacker)` (requires holding the ball and co-location or adjacent zone to target). R4. **Passing and Tagging Mechanics:** - A defender holding the ball cannot move (`speed = 0`). - `PASS_BALL(defender_j)`: Transfers ball instantly along line of sight with success probability P(pass)=0.90. If failed, the ball lands in a neutral adjacent zone. - `THROW_TAG(attacker_k)`: Throws ball at an attacker in the same or adjacent zone. Hit probability: P(hit)=0.80−0.20×distance. If hit, `attacker_k` is eliminated (`status = OUT`). The ball drops in the attacker's zone. R5. **Restacking Mechanics:** - An active attacker inside zone `(3, 3)` who executes `RESTACK_STONE()` increments `stones_restacked` by 1 per tick. - If `stones_restacked == 7`, the attacking team shouts *"Haft Sang!"*, wins the round immediately, and scores +1 point. R6. **Round Resolution & Role Swapping:** - If all attacking agents are eliminated before `stones_restacked == 7`, the defending team wins the round, scores +1 point, and teams swap roles for the next round. - If 60 ticks elapse without a completed tower or full elimination, the defending team is awarded the round win. [gap-fill: 60-tick timeout awarded to defenders]. R7. **Match Victory:** The first team to accumulate 3 points wins the match. ## Edge cases - Tie at the end condition: If both teams reach the point target on the same series or remain tied at match conclusion, a single-throw sudden-death shootout is played; first team to topple the tower and restack 1 stone fastest wins. [gap-fill: sudden-death shootout for ties]. - A player with no legal move: Not applicable; an agent always has valid `MOVE(0, 0)` (hold position) or passing options. - Repetition / cycles: Bounded strictly by the 60-tick limit per round and the finite match score target (3 points). - Simultaneous claims on the same resource or position: Multiple attackers can occupy zone `(3, 3)` simultaneously; each attacker executing `RESTACK_STONE()` contributes +1 to `stones_restacked` on that tick (cooperative parallel stacking). [gap-fill: parallel restacking allowed]. - Player elimination mid-round; turn order repair: Eliminated attackers enter state `OUT` and cease generating actions; remaining active attackers continue without turn order interruption. - Resource exhaustion (pieces, tokens, space, time): The 7 stones are finite. The 60-tick clock strictly exhausts. - Termination guarantee: Provably terminates because the round tick counter increments monotonically to 60, and each round awards exactly 1 point toward the 3-point victory threshold. ## State representation - **Persistent state:** - `match_scores`: `{team_a: integer, team_b: integer}` - `round_number`: integer - `attacker_team`: `Team A | Team B` - `tower_state`: `{standing: 0..7, restacked: 0..7}` - `ball_state`: `{holder: agent_id | None, zone: (x, y)}` - `agents`: list of `{id, team, role, zone: (x, y), status: ACTIVE | OUT}` - **Per-turn ephemeral state:** - `submitted_actions`: map of `agent_id -> Action` - `tags_resolved`: list of eliminated agent IDs - `stones_added_this_tick`: integer - **Observable information:** Fully observable. Positions of all agents, ball possession, stone count, and eliminated rosters are public knowledge. ## Action space - `move(dx, dy)`: Precondition: |dx|+|dy|≤1 and agent is not holding the ball. - `restack_stone()`: Precondition: Agent is Attacker, `status == ACTIVE`, and `zone == (3, 3)`. - `pass_ball(target_id)`: Precondition: Agent is Defender holding the ball. - `throw_tag(target_id)`: Precondition: Agent is Defender holding the ball, target is an active Attacker. ## Playability notes - Single-player-vs-AI: Highly tactical. The player can command an attacker (balancing evasion vs. rushing the tower) or act as the defensive ball distributor directing passes to corner the rebuilders. - Group games (n>4): Standard format is 4v4 to 6v6; reduces cleanly to 2 agents (1 Attacker vs. 1 Defender) on a smaller 4×4 grid, where the defender's no-run rule forces tactical ball-throwing rather than chasing. - Physical-skill games: Physical dodge reflexes and ball throwing accuracy are mapped into spatial distance probabilities. - What is lost in the adaptation: The physical sting of ball impacts, the tactile challenge of balancing jagged stones under time pressure, and the chaotic noise of street cheering. ## Implementation hints Medium complexity. Grid-based spatial rules make movement and pass-blocking straightforward. Suggested first milestone: implement the Phase 1 opening throw and Phase 2 attacker restacking loop against static defenders, then add defender passing and tag elimination logic.

Download as JSON

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

Download JSON
Cite this page

Seven Stones (Afghanistan). (n.d.). Games of Countries. https://gamesofcountries.com/games/af-afghanistan/haft-sang

@misc{gamesofcountries-af-afghanistan-haft-sang,
  title = {Seven Stones (Afghanistan)},
  year = {n.d.},
  publisher = {Games of Countries},
  url = {https://gamesofcountries.com/games/af-afghanistan/haft-sang}
}