Skip to main content
Formal Specification

The Wolf and the Sheep — Formal Specification

Malta · chase-tag · Confidence: low

← Back to game page

Implementation Suitability

Suitability: engine-readyFidelity: discretizedGap-fills: 2
# Il-Lupu u n-Nagħaġ — AI-optimized specification ## General idea A discretized predatory tag game on a 2D grid featuring asymmetric roles. Sheep advance from a safe Sheepfold towards a Wolf's Den during a ritual dialogue phase; on a trigger call, the Wolf bursts forth to chase Sheep back to the safety line while a Shepherd agent attempts to physically block pursuit angles. ## Formal model - **Abstraction taken:** The 15x15m playing field is discretized into a 2D grid `[0, X_max] x [0, Y_max]`. The safe Sheepfold is `x <= 2`; the Wolf Den is `x >= X_max - 2`. Movement is synchronous discrete step actions. - **Player/agent count:** 1 Wolf, 1 Shepherd, N Sheep (default N = 6). - **Turn model:** Two distinct phases: (1) Discrete dialogue sequence phase, (2) Synchronous real-time chase phase (`dt = 0.5s`). ## Formal rules R1. Setup: Wolf starts at `(X_max, Y_mid)`; Shepherd starts at `(2, Y_mid)`; Sheep start at `(1, y_i)`. R2. Phase 1 (Dialogue & Advance): R2.1. Dialogue counter `k = 0`. R2.2. On each step, Sheep advance `+1` cell in x-axis and query the Wolf. R2.3. Wolf responds with routine action with probability `1 - p_attack(k)` (where `p_attack` increases with `k`). R2.4. When Wolf responds with `ATTACK` (triggered guaranteed when `k >= 5` or Sheep `x >= X_max - 3`), Phase 2 begins immediately. R3. Phase 2 (Pursuit & Interception): R3.1. Wolf movement speed: 2 cells per tick. R3.2. Shepherd movement speed: 1 cell per tick. R3.3. Sheep movement speed: 1 cell per tick (moving toward `x <= 2`). R3.4. Shepherd blocking: If Shepherd occupies a cell adjacent to Wolf, Wolf is slowed to 1 cell per tick. R3.5. Tag check: If Wolf occupies the same cell as an uncaught Sheep with `x > 2`, that Sheep is captured (`captured[i] = true`). R3.6. Safe check: Sheep reaching `x <= 2` enter safe status (`safe[i] = true`). R4. Phase termination: Phase 2 terminates when all Sheep are either `captured` or `safe`. R5. [gap-fill] Scoring: Wolf scores 1 point per captured Sheep; Shepherd/Flock scores 1 point per safe Sheep. R6. [gap-fill] Role rotation: The surviving Sheep with the highest proximity to the Wolf before safety becomes the Shepherd in the next round. ## Edge cases - Tie at the end condition: If captured sheep equal safe sheep, match is drawn. - A player with no legal move: Not applicable — step actions in 4 cardinal directions are always legal. - Repetition / cycles: Bounded because Sheep movement is monotonically directed toward `x <= 2` during Phase 2. - Simultaneous claims on the same resource or position: Multiple sheep may occupy the same grid cell. - Player elimination mid-round: Captured sheep are removed from the active grid immediately. - Resource exhaustion: Not applicable. - Termination guarantee: Guaranteed by strictly decreasing distance between Sheep and the safety baseline `x <= 2`. ## State representation - Persistent state: `scores` (map role -> int), `round_number` (int). - Per-round ephemeral state: `phase` (enum: DIALOGUE / CHASE), `wolf_pos` `(x,y)`, `shepherd_pos` `(x,y)`, `sheep_states` (array of struct { `pos (x,y)`, `status: ACTIVE / SAFE / CAPTURED` }), `dialogue_step` (int). - Observable information: Fully observable by all agents. ## Action space - `move_step(direction)`: Step cardinal directions (North, South, East, West, Stay). - `trigger_attack()`: Wolf-only action during Phase 1. ## Playability notes - Single-player-vs-AI: Natural — human player controls the Wolf or the Shepherd coordinating defense against AI flock movements. - Group games (n>4): Multi-agent predator-prey coordination benchmark. - Physical-skill games: Physical body blocking and sprint feints abstracted into grid adjacency checks. - What is lost: The vocal theatrical suspense of reciting the Maltese dialogue in unison. ## Implementation hints 2D discrete grid state machine. First milestone: Verify the state transition from Phase 1 dialogue advance to Phase 2 pursuit.

Download as JSON

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

Download JSON
Cite this page

The Wolf and the Sheep (Malta). (n.d.). Games of Countries. https://gamesofcountries.com/games/mt-malta/il-lupu-u-n-naghag

@misc{gamesofcountries-mt-malta-il-lupu-u-n-naghag,
  title = {The Wolf and the Sheep (Malta)},
  year = {n.d.},
  publisher = {Games of Countries},
  url = {https://gamesofcountries.com/games/mt-malta/il-lupu-u-n-naghag}
}