Formal Specification
Algerian Sand Draughts — Formal Specification
Algeria · board-abstract · Confidence: medium
← Back to game pageImplementation Suitability
Suitability: engine-readyFidelity: directGap-fills: 1
# Kharbga Djazairia — AI-optimized specification
## General idea
A pure abstract strategy game played on a 7x7 grid. The match comprises an initial placement phase where players drop pieces into empty cells while keeping the center cell open, followed by a tactical movement phase using orthogonal steps and custodian sandwich captures with cascading multi-jump potential.
## 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. State & 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.
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 per R6.
- 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: Not applicable; 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 = [int, int]`, `no_capture_ply_count: int`.
- Ephemeral state: `active_moving_piece: Optional[(r, c)]` (during chain captures).
- 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): Not applicable; strictly 2-player.
- Physical-skill games: Not applicable; pure combinatoric board game.
- What is lost: The social ambiance of sipping mint tea in an oasis setting while spectators offer informal advice.
## Implementation hints
Bitboard or 2D array representation. First milestone: implement 7x7 board state, the two-phase state transition, and the orthogonal custodian capture detection.
Download as JSON
Download the full game corpus entry for this game as structured JSON.
Download JSONCite this page
Algerian Sand Draughts (Algeria). (n.d.). Games of Countries. https://gamesofcountries.com/games/dz-algeria/kharbga-algeria
@misc{gamesofcountries-dz-algeria-kharbga-algeria,
title = {Algerian Sand Draughts (Algeria)},
year = {n.d.},
publisher = {Games of Countries},
url = {https://gamesofcountries.com/games/dz-algeria/kharbga-algeria}
}