Skip to main content
Formal Specification

The Handkerchief Game — Formal Specification

Spain · chase-tag · Confidence: low

← Back to game page

Implementation Suitability

Suitability: engine-readyFidelity: discretizedGap-fills: 3
# El juego del pañuelo — AI-optimized specification ## General idea A two-team discretized spatial chase-and-tag game on a 1D or 2D grid. Two symmetrical teams line up at opposite boundaries. A referee calls a paired agent ID; both agents race to a central target item (the handkerchief). Grabbing the item reverses roles: the grabber becomes the fugitive who must reach home safety, while the rival becomes the chaser who must tag the fugitive before they cross the boundary. ## Formal model - **Abstraction taken:** The physical running space is discretized into a 1D grid X∈[−D,+D] with home base boundaries at XA=−D and XB=+D. Center item is at X=0. - **Player/agent count:** 2 teams of N agents each (typically N∈[3,8]). - **Turn model:** Real-time ticked simulation (e.g. 0.1s ticks) or discrete simultaneous movement steps per tick. ## Formal rules R1. Setup: Team A occupies X=−D, Team B occupies X=+D. Handkerchief sits at X=0. Each team assigns unique secret IDs 1..N to their members. Target score is Pwin=10 points (or full elimination). R2. Call: The referee agent broadcasts a random number k∈[1,N]. Only agent Ak and agent Bk become active. R3. Movement: Active agents move toward X=0 at speed v∈[0,vmax] cells per tick. R4. Neutral zone constraint: Neither agent may cross X=0 into the opponent's half before the handkerchief has been grabbed. Crossing X=0 without the handkerchief is an immediate fault (+1 point to the opponent). R5. Grab action: When an agent is at X=0, it may execute `grab_handkerchief()`. R6. Chase phase: The instant agent Ak grabs the handkerchief: - Ak role ←fugitive; must reach X≤−D. - Bk role ←chaser; must reach |XBk−XAk|≤TagRadius. R7. Round outcome: - If fugitive crosses home baseline (X≤−D) untagged: Fugitive's team scores +1 point. - If chaser tags fugitive (|Xchaser−Xfugitive|≤TagRadius) before home baseline: Chaser's team scores +1 point. R8. [gap-fill] Standoff timer: If neither agent grabs the handkerchief within 15.0 seconds of arrival at X=0, the round is declared void and a new number is called. R9. Win condition: The first team to accumulate Pwin points wins the match. ## Edge cases - **Tie at the end condition:** [gap-fill] If tied at Pwin−1, a deciding round is fought with all surviving players. - **A player with no legal move:** Not applicable; move forward, move backward, fake, and grab are always valid actions. - **Repetition / cycles:** Bounded by R8 standoff timer (15s cap per call). - **Simultaneous claims on the same resource or position:** If both agents execute `grab_handkerchief()` on the exact same tick, the grab is awarded via uniform random coin toss. - **Player elimination mid-round:** In elimination mode, the surviving team redistributes the eliminated player's number to an active player. - **Resource exhaustion:** Point target Pwin monotonically approaches completion. - **Termination guarantee:** Guaranteed by finite round timeouts (R8) and positive point accumulation every round. ## State representation - **Persistent state:** `team_scores` {A:int,B:int}, `active_rosters` (maps of ID → agents), `current_round` (∈ℕ). - **Per-round ephemeral state:** `called_id` (1..N), `pos_A` (XA), `pos_B` (XB), `item_holder` (null / A / B), `standoff_time_elapsed` (t≥0). - **Observable information:** Agent positions, item status, and scores are public; opponent number assignments are revealed when an agent responds to the call. ## Action space - `step(direction, speed)`: Where `direction` ∈{−1,+1,0}, `speed` ∈[0,vmax]. - `grab_handkerchief()`: Valid only when |X|≤GrabDistance and item is unheld. - `feint()`: Rapid speed perturbation to induce opponent overextension. ## Playability notes - **Single-player-vs-AI:** Natural; human directly steers active runner while AI computes optimal pursuit/feint trajectories. - **Group games (n>4):** Reduces to a series of 1v1 duels selected from the team roster. - **Physical-skill games:** Physical sprinting speed is discretized into velocity parameters with reaction delay noise: [gap-fill] Δtreaction=0.15+0.10×(1−skill). - **What is lost in the adaptation:** Physical breathlessness, ground turf slippage, and peripheral vision tracking. ## Implementation hints Low complexity. A 1D line grid with 2 agents and a central point item provides complete mechanics. First milestone: Implement 1D movement, center boundary check, and grab/tag role reversal logic.

Download as JSON

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

Download JSON
Cite this page

The Handkerchief Game (Spain). (n.d.). Games of Countries. https://gamesofcountries.com/games/es-spain/el-panuelo

@misc{gamesofcountries-es-spain-el-panuelo,
  title = {The Handkerchief Game (Spain)},
  year = {n.d.},
  publisher = {Games of Countries},
  url = {https://gamesofcountries.com/games/es-spain/el-panuelo}
}