Formal Specification
Tab (Egyptian Stave-Casting Board Race) — Formal Specification
Egypt · board-race · Confidence: medium
← Back to game pageImplementation Suitability
Suitability: engine-readyFidelity: directGap-fills: 2
# Tab — AI-optimized specification
## General idea
A turn-based stochastic race and capture game played on a 4-row grid. Players cast 4 binary palm-wood lots to accumulate movement points, unlock pieces from their starting row via specific roll thresholds, and steer pieces through a boustrophedon track to land directly on and capture opposing pieces.
## Formal model
- **Abstraction taken:** Stave tosses are modeled as the exact binomial distribution of 4 independent Bernoulli trials (assuming equal p=0.5 per face for symmetric staves):
- 1 White = Tab (value 1, bonus roll, P = 4/16 = 0.25)
- 2 White = 2 (value 2, no bonus, P = 6/16 = 0.375)
- 3 White = 3 (value 3, no bonus, P = 4/16 = 0.25)
- 4 White = 4 (value 4, bonus roll, P = 1/16 = 0.0625)
- 0 White = 6 (value 6, bonus roll, P = 1/16 = 0.0625)
- **Player/agent count:** 2 agents.
- **Turn model:** Sequential turns; active agent rolls staves until a non-bonus roll occurs, collecting a list of available movement values, then assigns those moves to pieces.
## Formal rules
R1. The board consists of 4 rows of columns (default ). Cells are indexed `(row, col)` with `row ∈ {0..3}`, `col ∈ {0..C-1}`.
R2. Player 1 pieces start in row 0; Player 2 pieces start in row 3. All pieces start `status = DORMANT`.
R3. On a turn, the agent rolls the 4-stave randomizer. If the result has bonus roll status (Tab=1, 4, or 6), the roll is added to `turn_rolls` and the agent rolls again; otherwise the roll is added and rolling ends.
R4. To activate a `DORMANT` piece, an available roll of value 1 (`Tab`) must be expended on it. The piece becomes `ACTIVE` and advances 1 step along the track.
R5. An `ACTIVE` piece can be advanced by any unused roll value along its fixed serpentine track:
- Track 1 (Player 1): Row 0 (col 0 to C-1) → Row 1 (col C-1 down to 0) → Row 2 (col 0 to C-1) → Row 3 (col C-1 down to 0).
- Track 2 (Player 2): Row 3 (col 0 to C-1) → Row 2 (col C-1 down to 0) → Row 1 (col 0 to C-1) → Row 0 (col C-1 down to 0).
R6. Captures: If an active piece finishes its move on a cell occupied by opponent piece(s) (whether dormant or active), all opponent piece(s) on that cell are captured and removed permanently.
R7. Stacking: Friendly pieces may occupy the same cell, forming a stack that moves together when landed upon by a trailing friendly piece.
R8. [gap-fill] Mandatory move execution: An agent must use all rolled values if legal moves exist; if no legal move exists for a value, that value is discarded.
R9. [gap-fill] Loop breaking / Repetition: A piece reaching the end of the enemy home row continues circling through rows 1 and 2; if 50 consecutive turns pass without any capture, the player with the most surviving pieces wins.
R10. Win condition: An agent wins when all opponent pieces are eliminated.
## Edge cases
- Tie at the end condition: Resolved via R9 if turn limit is reached; otherwise strictly impossible since win is by total elimination.
- A player with no legal move: Unused roll values are forfeited; turn passes to opponent.
- Repetition / cycles: Bounded by R9 (50 turns without capture triggers piece-count evaluation).
- Simultaneous claims on the same resource or position: Turns are sequential; landing on an opponent cell resolves as a capture immediately.
- Player elimination mid-round; turn order repair: Game ends immediately upon elimination of an agent's last piece.
- Resource exhaustion (pieces, tokens, space, time): Pieces strictly decrease through capture; board dimensions are constant.
- Termination guarantee: Guaranteed by the absorbing nature of captures and the 50-turn non-capture limit (R9).
## State representation
- Persistent state:
- `board_positions`: map of `piece_id` to `{row, col, status, player}`.
- `surviving_pieces`: `{PLAYER_1: int, PLAYER_2: int}`.
- `turns_since_last_capture`: integer counter.
- Per-turn ephemeral state:
- `turn_rolls`: list of integers `[v_1, v_2, ...]`.
- Observable information: Fully observable by all agents.
## Action space
- `unlock(piece_id)`: expend a roll of 1 to activate dormant piece.
- `move_piece(piece_id, roll_value)`: advance piece by specified roll value.
## Playability notes
- Single-player-vs-AI: Engine-ready; standard Expectiminimax or Monte Carlo Tree Search with chance nodes operates cleanly.
- Group games (n>4): Cleanly reduces to 2-agent partnership form (2 vs 2 sharing pieces on one side).
- Physical-skill games: Direct stave-toss probability distribution requires no motor modeling.
- What is lost in adaptation: The social rhyming chants associated with each stave roll are omitted.
## Implementation hints
Discrete and structured. The primary implementation task is mapping the serpentine 1D track onto the 4xN 2D board coordinates. First milestone: implement 4-stave binomial roll generator and track indexing before implementing stack merging.
Download as JSON
Download the full game corpus entry for this game as structured JSON.
Download JSONCite this page
Tab (Egyptian Stave-Casting Board Race) (Egypt). (n.d.). Games of Countries. https://gamesofcountries.com/games/eg-egypt/tab
@misc{gamesofcountries-eg-egypt-tab,
title = {Tab (Egyptian Stave-Casting Board Race) (Egypt)},
year = {n.d.},
publisher = {Games of Countries},
url = {https://gamesofcountries.com/games/eg-egypt/tab}
}