Formal Specification
Kuwaiti Three-in-a-Row Alignment Game — Formal Specification
Kuwait · board-abstract · Confidence: low
← Back to game pageImplementation Suitability
Suitability: engine-readyFidelity: directGap-fills: 1
# Al-Siba — AI-optimized specification
## General idea
A deterministic 2-player 3-in-a-row alignment game played on a 9-vertex graph (3x3 grid with diagonals and center hub). Features a placement phase followed by adjacent sliding movement with instant alignment win conditions.
## Formal model
- **Abstraction taken:** Direct graph representation `G = (V, E)` where `V = {0..8}` (a 3x3 grid) and `E` contains all horizontal, vertical, and diagonal edges passing through the center `4`. Full deterministic state machine.
- **Player/agent count:** 2 agents (Player 0 and Player 1).
- **Turn model:** Sequential alternating turns.
## Formal rules
R1. Graph Topology:
- Vertices: `0..8` (Row 0: 0,1,2; Row 1: 3,4,5; Row 2: 6,7,8).
- Alignment lines `L`: 8 triplets: 3 rows, 3 columns, 2 main diagonals.
R2. Phase 1: Placement:
- Hand pieces: `hand[0] = 3`, `hand[1] = 3`.
- Active player places 1 piece on any vacant vertex `v`.
- If placement forms a triplet in `L`: Active player wins immediately.
- When `hand = (0, 0)`, transition to Phase 2.
R3. Phase 2: Movement:
- Active player selects friendly piece at `v_from` and slides to adjacent vacant `v_to` along edge `(v_from, v_to) ∈ E`.
- If move forms a triplet in `L`: Active player wins immediately.
R4. Win and Draw Conditions:
- **Win Condition 1:** Complete an alignment of 3 friendly pieces along any line in `L`.
- **Win Condition 2:** Opponent has no legal moves on their turn (stalemate defeat).
- **Draw Condition:** Threefold state repetition. [gap-fill]
## Edge cases
- **Tie at the end condition:** Draw triggers on threefold state repetition.
- **A player with no legal move:** Stalemate results in immediate loss for the immobilized player.
- **Repetition / cycles:** Enforced threefold repetition rule prevents infinite shuffling.
- **Simultaneous claims on vertex:** Sequential turns prevent concurrent moves.
- **Player elimination mid-round:** Not applicable.
- **Resource exhaustion:** Exactly 3 pieces per player.
- **Termination guarantee:** Guaranteed by finite state space (9 choose 3 * 6 choose 3 = 1,680 states) and repetition rule.
## State representation
- **Persistent state:**
- `board: Array[9] of int` (-1 for EMPTY, 0 for P0, 1 for P1).
- `hand_pieces: Tuple[int, int]`.
- `current_player: int` (0 or 1).
- `phase: enum {PLACEMENT, MOVEMENT}`.
- `state_history: List[str]`.
- **Information set:** Perfect information, fully observable.
## Action space
- `place(vertex: int)`: Precondition: `phase == PLACEMENT`, `board[vertex] == EMPTY`.
- `move(from_v: int, to_v: int)`: Precondition: `phase == MOVEMENT`, `board[from_v] == current_player`, `board[to_v] == EMPTY`, `(from_v, to_v) ∈ E`.
## Playability notes
- **Single-player-vs-AI:** Solvable via Minimax; highly responsive game for baseline heuristic testing.
- **Group games:** Strictly 2-player zero-sum abstract.
- **Physical-skill model:** None (pure abstract strategy).
- **What is lost:** Tactile sand drawing.
## Implementation hints
Bitboard representation of 9 bits allows win line checks against precomputed 8-line bitmasks.
Download as JSON
Download the full game corpus entry for this game as structured JSON.
Download JSONCite this page
Al-Siba (Kuwait). (n.d.). Games of Countries. https://gamesofcountries.com/games/kw-kuwait/al-siba
@misc{gamesofcountries-kw-kuwait-al-siba,
title = {Al-Siba (Kuwait)},
year = {n.d.},
publisher = {Games of Countries},
url = {https://gamesofcountries.com/games/kw-kuwait/al-siba}
}