Skip to main content
Formal Specification

Libyan Sand Draughts — Formal Specification

Libya · board-abstract · Confidence: medium

← Back to game page

Implementation Suitability

Suitability: engine-readyFidelity: directGap-fills: 1
# Kharbga Libiya — AI-optimized specification ## General idea A pure abstract strategy game played on a 7x7 grid. Players alternate placing pairs of pieces during an initial setup phase while keeping the center cell vacant, followed by an orthogonal step-and-capture phase where sandwiched opponent pieces are eliminated via custodian captures and optional cascading chains. ## Formal model - **Abstraction taken:** Direct discrete formalization on a 7x7 coordinate lattice `{(r, c) | 0 <= r, c <= 6}`. - **Player/agent count:** 2 players (0 and 1). - **Turn model:** Sequential alternating turns. Phase 1: drop 2 pieces per turn. Phase 2: step and capture. ## Formal rules R1. Setup: Board is a 7x7 matrix initialized to `Empty`. Each player has an unplaced reserve of 24 pieces. R2. Phase 1 (Tanzil): - Player 0 places 2 pieces on any 2 distinct empty cells except `(3, 3)`. - Player 1 places 2 pieces on any 2 distinct empty cells except `(3, 3)`. - Placement alternates until all 48 pieces are on the board, leaving only cell `(3, 3)` vacant. R3. Phase 2 Transition: Player 1 (the second to place) takes the first movement turn into `(3, 3)`. R4. Legal Moves (Machy): - An active piece at `(r, c)` can move to an orthogonally adjacent empty cell `(r', c')` where `|r - r'| + |c - c'| == 1`. R5. Custodian Capture: - If a moved piece at `(r', c')` creates a sandwich configuration `[P_friendly, P_enemy, P_friendly]` along any orthogonal line, the sandwiched enemy piece is removed immediately. - If multiple orthogonal enemy pieces are simultaneously sandwiched, all are captured. - If a capture occurs, the player may optionally continue moving the same piece if another immediate capture is legal. - Moving voluntarily into a sandwich does NOT trigger capture. R6. Win Condition: A player wins immediately if the opponent has 0 pieces remaining or has no legal orthogonal moves available on their turn. ## Edge cases - Tie at the end condition: [gap-fill] If 40 consecutive moves occur without any piece capture, the game is declared a draw. - A player with no legal move: Treated as an immediate loss for the blocked player. - Repetition / cycles: Handled by the 40-move non-capture draw counter. - Simultaneous claims on the same resource or position: Sequential turn execution prevents position collisions. - Player elimination mid-round; turn order repair: 2-player game terminates upon elimination. - Resource exhaustion: Finite board capacity (49 cells) and finite pieces (24 each). - Termination guarantee: Guaranteed by monotonic piece reduction and the 40-move non-capture rule. ## State representation - Persistent state: `board: Array[7][7] in {Empty, P0, P1}`, `phase in {Tanzil, Machy}`, `reserve: Array[2][int]`, `no_capture_ply_count: int`. - Ephemeral state: `active_moving_piece: Optional[(int, int)]`. - Observability: Complete, perfect information. ## Action space - `place_pair((r1, c1), (r2, c2))`: Drop 2 pieces during Tanzil. - `step((r_src, c_src), (r_dst, c_dst))`: Orthogonal move during Machy. ## Playability notes - Single-player-vs-AI: Engine-ready; excellent candidate for Minimax with Alpha-Beta pruning or AlphaZero-style MCTS. - Group games (n>4): Strictly 2-player. - Physical-skill games: Pure combinatoric board game. - What is lost: The ambient social drama of a desert oasis tea circle. ## Implementation hints Bitboard or 2D array representation. First milestone: implement 7x7 board state, the two-phase state transition, and orthogonal custodian capture detection.

Download as JSON

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

Download JSON
Cite this page

Libyan Sand Draughts (Libya). (n.d.). Games of Countries. https://gamesofcountries.com/games/ly-libya/kharbga-libya

@misc{gamesofcountries-ly-libya-kharbga-libya,
  title = {Libyan Sand Draughts (Libya)},
  year = {n.d.},
  publisher = {Games of Countries},
  url = {https://gamesofcountries.com/games/ly-libya/kharbga-libya}
}