Formal Specification
Handkerchief of the Apothecary / Lenço Atrás — Formal Specification
Portugal · singing-circle · Confidence: low
← Back to game pageImplementation Suitability
Suitability: engine-readyFidelity: discretizedGap-fills: 3
# Lencinho da Botica — AI-optimized specification
## General idea
A multi-agent circular chase and alertness game on a 6-node ring graph. A designated runner secretly deposits a token behind one of the circle nodes while singing, triggering a race around the ring between the runner and the selected defender to secure the vacated circle slot before being tagged.
## Formal model
- **Abstraction taken:** The physical circular perimeter is modeled as a discrete ring graph `C_6 = {0..5}` with clockwise directed distance metrics. Sprinting speeds and detection latencies are modeled as discrete movement points per tick.
- **Player/agent count:** 6 agents (Agent 0 = Runner; Agents 1..5 occupy slots 0..4 in the circle).
- **Turn model:** Phase-based: Drop Phase (secret selection) -> Reaction/Detection Phase -> Sprint Chase Phase (simultaneous ticks).
## Formal rules
R1. Setup: Ring graph `V = {0..5}` with positions ordered cyclically. Slot 5 is empty. Agent 0 is `Runner`. Agents 1..5 occupy slots 0..4. Center position `Choco` is empty.
R2. Drop Phase:
- Runner selects a target slot `s in {0..4}` to drop the handkerchief.
- The identity of target slot `s` is hidden from all circle agents until their detection check triggers.
R3. Detection Phase:
- Each circle agent `i` at slot `k` has an attention check per tick: `P(detect) = 0.70` if `k == s`, `0.0` otherwise [gap-fill].
- Detection latency `L_react` (number of ticks before the defender at slot `s` notices the token) is sampled: `L_react ~ Geometric(0.70)`.
R4. Sprint Chase Phase:
- Runner must travel from slot `s` to slot `s` (a full lap of 6 edges) to claim the vacated spot.
- Defender at slot `s` starts sprinting after `L_react` ticks and must catch the Runner before the Runner traverses 6 edges.
- Both Runner and Defender have standard speed of 1 edge per tick [gap-fill].
- Runner distance to safety = `6 - tick`.
- Defender distance to Runner = `6 - (tick - L_react)`.
R5. Resolution:
- If Defender catches Runner before Runner completes lap (`tick - L_react >= tick - 6`, meaning `L_react <= 0` at catch point): Tag successful! Runner is sent to `Choco` (receives 1 penalty point), and a random circle agent becomes the new Runner.
- If Runner reaches slot `s` before being tagged: Runner safely claims slot `s`. The Defender becomes the new Runner for the next round.
R6. Galinha Choca Steal:
- If `L_react > 6` (defender failed to notice for an entire lap), the agent in `Choco` steals the spot automatically; the inattentive defender is sent to `Choco` [gap-fill].
R7. Win condition: Match terminates after 10 completed chase rounds. The agent with the lowest penalty points wins.
## Edge cases
- Tie at the end condition: If multiple agents tie for lowest penalty points, sudden-death 2-round playoff decides.
- A player with no legal move: Not applicable; choosing a drop slot or sprinting is always available.
- Repetition / cycles: Strictly bounded by the 10-round counter.
- Simultaneous claims on the same resource or position: Handled via distance calculation in R4 and R5.
- Player elimination mid-round: If an agent disconnects, the ring collapses to `N - 1` nodes.
- Resource exhaustion (pieces, tokens, space, time): Match concludes at round 10.
- Termination guarantee: Finite round horizon (10 rounds) guarantees termination.
## State representation
- Persistent state: `penalties: [int; 6]`, `current_runner: int`, `round_number: int (1..10)`.
- Per-round ephemeral state: `target_slot: int`, `detection_tick: int`, `runner_progress: int`, `defender_progress: int`, `choco_occupant: int (-1 if empty)`.
- Information sets:
- Runner observes: chosen drop target `s`, own position, defender reaction state.
- Circle agents observe: whether the handkerchief has been detected at their own node only.
## Action space
- Runner: `drop_handkerchief(slot_index: int)` where `slot_index in {0..4}`.
- Circle Agent: `monitor_back()` (routine check).
## Playability notes
- Single-player-vs-AI: Engine-ready. Player controls Runner (timing and target selection) or Defender (reaction response).
- Group games (n>4): Native 6-agent discrete model captures authentic drop-handkerchief ring dynamics.
- Physical-skill games: Physical running burst and tactile detection modeled via reaction latency distributions.
- What is lost in the adaptation: Chanting melody, physical shoulder glancing, and circular stumbling.
## Implementation hints
Ring graph of 6 nodes. Simple deterministic distance subtraction with stochastic reaction latency. Suggested milestone 1: Implement the Drop -> Latency -> Sprint state machine and verify role transitions.
Download as JSON
Download the full game corpus entry for this game as structured JSON.
Download JSONCite this page
Handkerchief of the Apothecary / Lenço Atrás (Portugal). (n.d.). Games of Countries. https://gamesofcountries.com/games/pt-portugal/lencinho-da-botica
@misc{gamesofcountries-pt-portugal-lencinho-da-botica,
title = {Handkerchief of the Apothecary / Lenço Atrás (Portugal)},
year = {n.d.},
publisher = {Games of Countries},
url = {https://gamesofcountries.com/games/pt-portugal/lencinho-da-botica}
}