Formal Specification
Moroccan hopscotch — Formal Specification
Morocco · dexterity-throw · Confidence: medium
← Back to game pageImplementation Suitability
Suitability: engine-readyFidelity: probabilistic-proxyGap-fills: 2
# Hajla — AI-optimized specification
## General idea
A sequential hopscotch throwing and balance game on a 9-compartment grid. Players advance through levels 1 to 8 by pitching a stone marker into the target square, executing an obstacle-avoiding hopping sequence on one/two feet, and retrieving the stone on the return path. Completing the sequence allows purchasing exclusive resting squares (*Dar*).
## Formal model
- **Abstraction taken:** The physical stone throw and single-leg balance hops are parameterized as stochastic success checks: and .
- **Player/agent count:** 2 to 6 agents in fixed rotational order.
- **Turn model:** Sequential turns. A player retains the turn on success and passes the turn immediately on a fault.
## Formal rules
R1. **Grid Geometry & Levels:**
- Grid compartments: 1 (single), 2 (single), 3 (single), (4, 5) (paired), 6 (single), (7, 8) (paired), 9 (*Jenna* / rest zone).
- Level progression: Each player begins at `current_level = 1` (target square 1) and progresses to 8.
R2. **Stone Pitching Phase:**
- Active player executes `pitch_stone(target_level)`.
- Pitch lands successfully in square `target_level` with probability .
- If pitch misses or touches boundary lines, a fault is triggered and turn ends.
R3. **Hopping Phase:**
- If pitch succeeds, agent executes a hopping sequence across cells :
- Must not step in square containing the stone on the outward journey.
- Must not step in any square owned as a *Dar* by an opponent.
- Single squares require 1-foot balance check ().
- Paired squares allow 2-foot straddle landing ().
- At cell 9 (*Jenna*), agent executes a 180° turn ().
- Return journey: Agent hops back; at cell adjacent to target stone, executes `retrieve_stone()` (), hops over stone cell, and exits at cell 1.
R4. **Faults & Turn Transition:**
- If any action fails during R2 or R3, player state remains at `current_level`, and turn passes to the next player in rotation.
- If all actions succeed, player increments `current_level = current_level + 1` and takes an immediate next turn.
R5. **House Acquisition (*Dar*):**
- Upon completing level 8, player executes `blind_throw()`. If stone lands in cell not already owned, that cell becomes `owner(k) = player_id`.
R6. **Victory Condition:**
- [gap-fill] The first player to successfully acquire 2 *Dar* (or complete 2 full cycles) wins the match.
## Edge cases
- **Tie at the end condition:** Not applicable — win condition is reached dynamically on a player's individual turn.
- **A player with no legal move:** Pitching or hopping is always legal on one's turn.
- **Repetition / cycles:** Bounded by stochastic progress; success probabilities ensure eventual level completion. [gap-fill] If all players fail for 30 consecutive aggregate rounds, the player with the highest `current_level` wins.
- **Simultaneous claims on the same resource or position:** Turns are sequential; a cell owned as *Dar* cannot be claimed by another player.
- **Player elimination mid-round; turn order repair:** If a player drops out, their owned *Dar* become unowned and turn rotation skips them.
- **Resource exhaustion:** Finite board of 8 numbered squares and 1 Jenna.
- **Termination guarantee:** Guaranteed by strictly non-decreasing level states and the 30-round limit.
## State representation
- **Persistent state:** List of player states: `[current_level, owned_houses, status]`, grid array `Dar_owner[1..8]`, active player index .
- **Ephemeral per-turn state:** Thrown stone position , current hop position index .
- **Observable information:** Fully observable state.
## Action space
- `pitch_stone(target_square)`: Aim parameter .
- `hop_step(destination_cell, stance)`: `stance` .
- `retrieve_stone()`.
- `blind_throw()`.
## Playability notes
- **Single-player-vs-AI:** Natural as a solitaire time-attack / failure-minimization challenge or playing against simulated AI opponents.
- **Group games ():** Turn rotation scales cleanly to agents; increasing players increases board contention through opponent *Dar* obstacles.
- **Physical-skill games:** Skill parameter directly modulates .
- **What is lost in the adaptation:** Physical balance fatigue, chalk dust, and joyful neighborhood shouting.
## Implementation hints
- Implement grid as a 1D state machine of cells with step transition costs and obstacle verification before adding continuous physics coordinates.
- First milestone: Implement single-player level 1–8 progression with deterministic throws to verify rule logic.
Download as JSON
Download the full game corpus entry for this game as structured JSON.
Download JSONCite this page
Moroccan hopscotch (Morocco). (n.d.). Games of Countries. https://gamesofcountries.com/games/ma-morocco/hajla
@misc{gamesofcountries-ma-morocco-hajla,
title = {Moroccan hopscotch (Morocco)},
year = {n.d.},
publisher = {Games of Countries},
url = {https://gamesofcountries.com/games/ma-morocco/hajla}
}