Skip to main content
Formal Specification

Traditional Moroccan marketplace memory game — Formal Specification

Morocco · riddle-word · Confidence: medium

← Back to game page

Implementation Suitability

Suitability: engine-readyFidelity: directGap-fills: 1
# Labet es-Souk — AI-optimized specification ## General idea A deterministic cumulative memory and sequence recall game. An ordered sequence of symbolic dictionary tokens S=[w1,w2,…,wk] grows by one unique element on each turn. The active agent must reproduce the exact sequence S from memory within a finite time budget and append a legal, previously unused token wk+1∈𝒱∖S. Any omission, permutation, invalid token, or timeout results in immediate elimination. ## Formal model - **Abstraction taken:** Natural language phrases are mapped directly into a finite categorical vocabulary of market commodities 𝒱={v1,…,vM} (M≥50). Turn submissions are validated via string/token sequence equality. - **Player/agent count:** N players in active rotation queue Q=[A0,…,AN−1] (N∈[2,8], default N=4). - **Turn model:** Sequential elimination queue. ## Formal rules R1. **Vocabulary & Setup:** - Finite vocabulary 𝒱 of M unique market items. - Active cumulative sequence starts empty: S=[]. - Active players list Q=[A0,…,AN−1]. Active player index p=0. R2. **Turn Submission & Verification:** - On active turn, player Ap must submit action `recite_and_append(recalled_sequence, new_item)` within time limit τmax⁡=5.0 seconds: - **Recall Verification:** recalled_sequence==S (exact length, ordering, and token identity). - **New Item Legality:** new_item∈𝒱∧new_item∉S. R3. **Resolution of Success & Faults:** - **Success:** - Sequence updates: S←S+[new_item]. - Active turn advances to next player: p←(p+1)(mod|Q|). - **Fault Event:** - If recall mismatch, invalid/duplicate item, or timeout (Δt>τmax⁡): - Agent Ap is eliminated: Q←Q∖{Ap}. - Sequence S remains intact at its current state. - Active index updates to next surviving player: p←p(mod|Q|). R4. **Victory Condition:** - The game terminates immediately when |Q|==1 (single surviving player). - The surviving agent is declared the Winner. ## Edge cases - **Tie at the end condition:** Not applicable — players are eliminated sequentially; exactly one survivor remains. - **A player with no legal move:** If the vocabulary is completely exhausted (|S|==|𝒱|), [gap-fill] the sequence is cleared, all remaining active players receive +1 point, and a new round begins. - **Repetition / cycles:** Impossible — each turn strictly increases |S| by 1, and agent memory limits or vocabulary bounds |𝒱| guarantee failure within finite turns. - **Simultaneous claims on the same resource or position:** Turns are strictly sequential in queue Q. - **Player elimination mid-round; turn order repair:** Handled strictly by R3 (Q removes failing agent, active index modulo-clamped). - **Resource exhaustion:** Vocabulary 𝒱 is bounded (M tokens); handled by R4. - **Termination guarantee:** Guaranteed by monotonic player elimination until |Q|=1. ## State representation - **Persistent state:** Vocabulary set 𝒱, surviving player queue Q, active player index p, cumulative sequence list S=[w1,…,wk]. - **Ephemeral state:** Turn start timestamp t0, submitted recall tokens. - **Observable information:** Perfect information — full sequence history is publicly broadcast upon each successful turn. ## Action space - `recite_and_append(recalled_list, new_token)`: - `recalled_list`: Array of string tokens. - `new_token`: String token ∈𝒱. ## Playability notes - **Single-player-vs-AI:** Highly playable: human tests working memory capacity against AI agents programmed with varying memory decay models (e.g. Recurrent Neural Networks or forgetting curves). - **Group games (N>4):** Scales naturally with multi-agent elimination. - **Physical-skill games:** Not applicable (pure cognitive working memory and verbal agility). - **What is lost in the adaptation:** The lively family banter, funny throat-clearing, and aromatic Moroccan mint tea served between turns. ## Implementation hints - Implement as a simple list append and array comparison check with a timer wrapper. - First milestone: Implement 2-player game loop verifying sequence accumulation and mismatch elimination triggers.

Download as JSON

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

Download JSON
Cite this page

Traditional Moroccan marketplace memory game (Morocco). (n.d.). Games of Countries. https://gamesofcountries.com/games/ma-morocco/souk

@misc{gamesofcountries-ma-morocco-souk,
  title = {Traditional Moroccan marketplace memory game (Morocco)},
  year = {n.d.},
  publisher = {Games of Countries},
  url = {https://gamesofcountries.com/games/ma-morocco/souk}
}