Formal Specification
Tunisian Hopscotch — Formal Specification
Tunisia · dexterity-throw · Confidence: medium
← Back to game pageImplementation Suitability
Suitability: engine-readyFidelity: probabilistic-proxyGap-fills: 1
# El-Hajla Tounissia — AI-optimized specification
## General idea
A sequential turn-based hopscotch game on a linear graph of 8 chambers. Players toss a stone into sequential boxes and navigate the court on single-leg hops to complete circuits. Completing all 8 circuits enables backward marker tosses to claim private "houses", altering court traversal costs for opponents.
## Formal model
- **Abstraction taken:** Physical stone-pitching and single-leg jumping balance are modeled via success probabilities parameterized by target distance and player balance attribute `Bal in [0, 100]`.
- **Player/agent count:** `N` agents (default `N = 2`, Player 0 and Player 1).
- **Turn model:** Sequential turn rotation. A turn continues through circuit traversal until a fault occurs or the circuit finishes cleanly.
## Formal rules
R1. Setup: Court has 8 boxes indexed `1..8`. House ownership map `HouseOwner: Array[8] in {None, P0, P1}` initialized to `None`. Player progress tracks `Stage: Array[N] in [1..8]` initialized to `1`.
R2. Toss Step:
- Active agent attempts `toss_marker(target_box = Stage[i])`.
- Toss success probability `P_toss = 0.90 - 0.04 * target_box`.
- If toss fails (lands on line or out of bounds), agent commits a `Fault` and turn ends immediately.
R3. Traversal Step:
- If toss succeeds, agent executes traversal sequence `HopSequence(1..8)` excluding `target_box`.
- For each box `k`:
- If `HouseOwner[k] == active_player`: agent rests both feet (`Bal + 5`, step success `1.0`).
- If `HouseOwner[k] == opponent`: agent must jump over box `k` in a single double-length hop (`P_step = 0.70`).
- If `HouseOwner[k] == None`: standard hop (`P_step = 0.92`).
- If all hops succeed, agent retrieves marker at `target_box`, exits court, and increments `Stage[i] += 1`.
R4. House Purchase Phase:
- When an agent completes `Stage == 8`, on their next turn they execute `backward_toss()`.
- Backward toss lands uniformly at random on an unclaimed box `c in {1..8}`.
- `HouseOwner[c]` is assigned to the tossing agent.
R5. Win Condition: When all 8 boxes have `HouseOwner != None` (or when one agent secures `>= 5` houses), the game terminates; the agent owning the most houses wins.
## Edge cases
- Tie at the end condition: If both agents own exactly 4 houses on an 8-box court, the match ends in a formal draw.
- A player with no legal move: Not applicable; toss action is always legal.
- Repetition / cycles: [gap-fill] If 30 consecutive player turns elapse without any advance in `Stage` or `HouseOwner`, the match terminates and is evaluated on current stage progress.
- Simultaneous claims on the same resource or position: Sequential house claiming prevents simultaneous claims on the same chamber.
- Player elimination mid-round; turn order repair: Not applicable; no elimination.
- Resource exhaustion: Exactly 8 chambers available to be purchased.
- Termination guarantee: Enforced by the 30-turn stagnation breaker and finite 8-chamber capacity.
## State representation
- Persistent state: `stage = Array[N][int]`, `houses = Array[8][Optional[int]]`, `active_player in [0..N-1]`, `stagnation_counter: int`.
- Ephemeral state: `current_toss_box: int`.
- Observability: Complete, perfect information.
## Action space
- `toss_marker(target_box)`: Standard stage progression toss.
- `execute_traversal()`: Runs balance/hop resolution across the court.
- `backward_toss()`: Triggered once `Stage > 8`.
## Playability notes
- Single-player-vs-AI: Natural single-agent obstacle time-trial or 2-agent competitive race.
- Group games (n>4): Extends smoothly to multi-agent turn loops.
- Physical-skill games: Dynamic balance recovery modeled via success chance curves.
- What is lost: The physical sensation of hopping on one foot on hot stone slabs and balancing on tiptoes.
## Implementation hints
Graph-based state machine. First milestone: implement linear 8-chamber traversal loop, marker skip checks, and house ownership assignment.
Download as JSON
Download the full game corpus entry for this game as structured JSON.
Download JSONCite this page
Tunisian Hopscotch (Tunisia). (n.d.). Games of Countries. https://gamesofcountries.com/games/tn-tunisia/hajla-tunisia
@misc{gamesofcountries-tn-tunisia-hajla-tunisia,
title = {Tunisian Hopscotch (Tunisia)},
year = {n.d.},
publisher = {Games of Countries},
url = {https://gamesofcountries.com/games/tn-tunisia/hajla-tunisia}
}