Formal Specification
Moroccan draughts — Formal Specification
Morocco · board-abstract · Confidence: medium
← Back to game pageImplementation Suitability
Suitability: engine-readyFidelity: directGap-fills: 2
# Dama Maghribiya — AI-optimized specification
## General idea
A 2-player Moroccan abstract strategy draughts game played on an 8x8 grid with 12 pieces per player. Distinguishing mechanics include mandatory maximum-piece capture priority, flying queens with long-range diagonal jumps, and loss-by-immobilization.
## Formal model
- **Abstraction taken:** Direct representation on an discrete chequered grid (32 playable dark squares).
- **Player/agent count:** 2 agents ().
- **Turn model:** Strictly alternating sequential turns.
## Formal rules
R1. **Board Topology & Setup:**
- Board is an grid. Playable squares are where .
- pieces start on rows (12 men).
- pieces start on rows (12 men).
- Rows 3 and 4 are initially empty.
R2. **Piece Types & Movement:**
- **Man:**
- Forward direction: in row for , in row for .
- Non-capturing move: 1 step diagonally forward to an adjacent empty square.
- Capture move: Leap over an adjacent enemy piece diagonally (forward or backward) to a vacant square immediately beyond. Captured piece is removed.
- **Queen (*Soltana*):**
- Promoted when a man reaches the opposing baseline ( for , for ).
- Non-capturing move: Any number of vacant squares along any unobstructed diagonal (all 4 directions).
- Capture move: Leap over an enemy piece at any distance along a diagonal and land on any vacant square beyond it along that diagonal.
R3. **Capture Mandate & Maximum Capture Priority:**
- If any capture is available, non-capturing moves are illegal.
- If multiple capture sequences are possible, the agent **must** execute a sequence that captures the maximum count of enemy pieces.
- Among sequences capturing equal count, the sequence capturing the highest total piece value () must be selected.
R4. **Naffakh Rule in Automated Play:**
- [gap-fill] Since an automated engine strictly enforces legal moves, illegal non-capture moves cannot be submitted; however, in simulation vs casual human agents, submitting an illegal non-capture when a capture exists triggers automatic forfeiture of the offending piece.
R5. **Win / Loss / Draw Conditions:**
- A player wins if the opponent has 0 pieces remaining.
- A player wins if the opponent has pieces but 0 legal moves on their turn (stalemate is a loss for the player whose turn it is).
- [gap-fill] A draw occurs upon threefold repetition of the exact board position or 40 consecutive moves with no captures or promotions.
## Edge cases
- **Tie at the end condition:** Handled by R5 (threefold repetition or 40-move rule leads to a declared draw).
- **A player with no legal move:** Handled strictly by R5: immobilization is a loss for the immobilized player.
- **Repetition / cycles:** Bounded by the threefold repetition and 40-move non-capture rule (R5).
- **Simultaneous claims on the same resource or position:** Not applicable — turns are strictly sequential.
- **Player elimination mid-round; turn order repair:** Not applicable — 2-player zero-sum game.
- **Resource exhaustion:** Finite board and finite pieces (12 per side).
- **Termination guarantee:** Guaranteed by monotonic piece reduction and the 40-move cycle breaker.
## State representation
- **Persistent state:** Board grid , active player , half-move clock (since last capture/promotion), position history hash table.
- **Observable information:** Perfect information — full board state is fully observable to both agents.
## Action space
- `move(from_r, from_c, to_r, to_c)`: Simple non-capturing diagonal slide.
- `jump(from_r, from_c, path)`: Multi-jump sequence where `path` is an ordered list of landing coordinates capturing the maximal sequence of opponent pieces.
## Playability notes
- **Single-player-vs-AI:** Direct and ideal: Alpha-Beta Minimax with bitboards or MCTS solves and plays at superhuman level.
- **Group games ():** Not applicable (pure 2-player combinatorial game).
- **Physical-skill games:** Not applicable (pure abstract board game).
- **What is lost in the adaptation:** The lively street-café atmosphere, verbal heckling, and theatrical blowing on confiscated pieces (*Naffakh*).
## Implementation hints
- Represent board state using two 32-bit integers per player (one for men, one for queens) for high-performance bitboard move generation.
- First milestone: Implement board setup, diagonal step generator, and single-jump capture validation before adding multi-jump maximal sequence pruning.
Download as JSON
Download the full game corpus entry for this game as structured JSON.
Download JSONCite this page
Moroccan draughts (Morocco). (n.d.). Games of Countries. https://gamesofcountries.com/games/ma-morocco/dama
@misc{gamesofcountries-ma-morocco-dama,
title = {Moroccan draughts (Morocco)},
year = {n.d.},
publisher = {Games of Countries},
url = {https://gamesofcountries.com/games/ma-morocco/dama}
}