Formal Specification
Fox and Sheep — Formal Specification
Iceland · board-abstract · Confidence: high
← Back to game pageImplementation Suitability
Suitability: engine-readyFidelity: directGap-fills: 6
# Refskák — AI-optimized specification
## General idea
An asymmetric two-player hunt board game simulating a fox preying on a sheep fold. One player commands a single versatile Fox attempting to capture sheep by leaping over them, while the opponent commands 13 Sheep attempting to coordinate a dense geometric cordon to corner and immobilize the Fox. The game is played on a 33-point cross board with orthogonal and diagonal connections, featuring perfect information and fully deterministic movement.
## Formal model
- **Abstraction taken:** None — the traditional rules form a complete discrete abstract graph system. Formalization only specifies graph topology, forward-movement constraints, and loop-breaking conditions.
- **Player/agent count:** 2 players (Player 1: Fox with 1 piece; Player 2: Sheep with 13 pieces).
- **Turn model:** Strictly alternating sequential turns.
## Formal rules
R1. Setup: The board is a cross-shaped graph of 33 vertices (a 7x7 grid with four 2x2 corner blocks omitted). All adjacent grid points along ranks and files are connected by orthogonal edges; diagonals connect vertices on alternating 3x3 quadrants in the standard Alquerque cross pattern. The Fox is placed on the central vertex (coordinate `(3, 3)` in 0-indexed 7x7 space). 13 Sheep occupy the top 9 vertices of the upper arm `{(2,0), (3,0), (4,0), (2,1), (3,1), (4,1), (2,2), (3,2), (4,2)}` and the 4 adjacent lateral shoulder vertices `{(0,2), (1,2), (5,2), (6,2)}`.
R2. Turn order: Sheep move first. Players alternate single turns.
R3. Sheep movement: On their turn, the Sheep player moves exactly one sheep along a connected edge to an immediately adjacent vacant vertex. In traditional 13-sheep Halatafl, sheep may move forward (downward toward higher row indices) or sideways (left/right along the same row), but never backward (upward toward lower row indices) [gap-fill]. Sheep cannot jump, capture, or occupy occupied vertices.
R4. Fox movement: On a non-capturing turn, the Fox moves exactly one step along any connected edge (orthogonal or diagonal) in any direction to an adjacent vacant vertex.
R5. Fox capture: If an adjacent vertex along a connected straight line is occupied by a sheep and the vertex immediately beyond it along the same straight line is vacant, the Fox may jump over the sheep and land on the vacant vertex, immediately capturing and removing the jumped sheep from the board. Captures are optional for the Fox [gap-fill].
R6. Multiple captures: If from the landing vertex after a jump capture the Fox can immediately execute another valid jump capture along a connected line, the Fox may chain multiple consecutive captures in the same turn. The turn ends when the Fox chooses to stop or when no further jumps are possible.
R7. Win conditions:
- Sheep win immediately if the Fox is immobilized (the Fox has zero legal single-step moves and zero legal jump captures on its turn).
- Fox wins immediately if the flock is reduced to 5 or fewer sheep [gap-fill], rendering containment mathematically impossible, or if the Sheep player has no legal moves on their turn [gap-fill].
R8. Draw condition: [gap-fill] A threefold repetition of the identical board state with the same player to move, or 40 consecutive moves by the Sheep without a capture, constitutes an immediate draw.
## Edge cases
- Tie at the end condition: Not applicable — win conditions are asymmetric and mutually exclusive; simultaneous trigger cannot occur under alternating turns.
- A player with no legal move: If Fox has no legal move, Sheep win (R7). If Sheep have no legal move, Fox wins (R7).
- Repetition / cycles: Bounded by R8; [gap-fill] threefold repetition rule and 40-move non-capture rule prevent infinite positional cycling.
- Simultaneous claims on the same resource or position: Not applicable — turns are strictly sequential and each vertex holds at most one piece.
- Player elimination mid-round; turn order repair: Not applicable — exactly 2 players; sheep pieces are eliminated monotonically but player roles persist.
- Resource exhaustion: Sheep pieces are finite (13) and non-renewable; vertices are fixed at 33.
- Termination guarantee: Guaranteed by monotonic piece reduction toward the threshold of ≤5 sheep, combined with R8 cycle-breaking limits.
## State representation
- Persistent state:
- `fox_pos`: integer vertex ID `[0..32]`.
- `sheep_positions`: bitmask (33-bit integer) representing vertex occupancy by sheep.
- `turn`: `{FOX, SHEEP}`.
- `move_count_without_capture`: integer counter.
- `history`: set of visited state hashes.
- Per-turn ephemeral state:
- `move_path`: sequence of vertex IDs traversed during Fox jumps or single Sheep step.
- `captured_sheep`: list of removed sheep vertex IDs.
- Observable information:
- Complete information; all piece positions, board graph topology, and move history are fully observable by both players.
## Action space
- `move_sheep(from_vertex, to_vertex)`:
- Preconditions: `turn == SHEEP`, `from_vertex` contains a sheep, `to_vertex` is empty, `to_vertex` is connected to `from_vertex`, row(`to_vertex`) >= row(`from_vertex`).
- `step_fox(to_vertex)`:
- Preconditions: `turn == FOX`, `to_vertex` is empty, `to_vertex` is connected to `fox_pos`.
- `jump_fox(jump_sequence)`:
- Preconditions: `turn == FOX`, each jump in sequence is a straight-line hop over an adjacent sheep onto an immediately vacant vertex.
## Playability notes
- Single-player-vs-AI: Natural — standard alpha-beta minimax or MCTS applies directly. Fox plays aggressive mobility maximization; Sheep plays territory restriction.
- Group games (n>4): Not applicable — strictly 1v1.
- Physical-skill games: Not applicable — pure discrete abstract board game.
- What is lost in the adaptation: None; the historical cross geometry, 13-sheep directional constraint, and capture mechanics are preserved completely.
## Implementation hints
- Represent the 33-point board as an adjacency list / bitboard graph with precomputed straight-line jump pairs `(over, land)`.
- Branching factor is very low: 1–6 moves for Fox, 2–10 moves for Sheep.
- Suggested first milestone: implement graph connectivity, sheep forward/sideways move validation, Fox single and multi-hop jump execution, and sheep immobilization detection.
Download as JSON
Download the full game corpus entry for this game as structured JSON.
Download JSONCite this page
Fox and Sheep (Iceland). (n.d.). Games of Countries. https://gamesofcountries.com/games/is-iceland/refskak
@misc{gamesofcountries-is-iceland-refskak,
title = {Fox and Sheep (Iceland)},
year = {n.d.},
publisher = {Games of Countries},
url = {https://gamesofcountries.com/games/is-iceland/refskak}
}