Skip to main content
Formal Specification

Khmer Chess — Formal Specification

Cambodia · board-abstract · Confidence: low

← Back to game page

Implementation Suitability

Suitability: engine-readyFidelity: directGap-fills: 1
# Ouk Chaktrang — AI-optimized specification ## General idea A fully deterministic, perfect-information 2-player board game played on an 8x8 uncheckered grid. Pawns (*Trey*) start advanced on rank 3 and promote on rank 6 into diagonally moving *Trey Bak*. Kings (*Ang*) possess an optional initial knight leap, and Queens (*Neang*) an initial 2-square forward advance. A structured endgame counting table strictly bounds lone-king endgames against indefinite stalling. ## Formal model - **Abstraction taken:** None — direct formalization of standard federation rules. - **Player/agent count:** 2 agents (PWhite, PBlack). - **Turn model:** Sequential, strictly alternating. PWhite moves first. ## Formal rules R1. Board & Topology: 8x8 uncheckered square grid. Files a..h, Ranks 1..8. R2. Initial Piece Positions: - White (PWhite): - a1, h1: Touk; b1, g1: Ses; c1, f1: Koul; d1: Neang; e1: Ang. - a3..h3: 8 Trey. (Rank 2 is empty). - Black (PBlack): - a8, h8: Touk; b8, g8: Ses; c8, f8: Koul; d8: Neang; e8: Ang. - a6..h6: 8 Trey. (Rank 7 is empty). R3. Movement and Capture Rules: - `Ang`: 1 step in 8 directions (orthogonal + diagonal). If un-moved and not in check, can make an initial knight leap to an empty square without capturing. - `Neang`: 1 step in 4 diagonal directions. If un-moved, may advance 2 squares straight forward if the intermediate square is empty. - `Koul`: 1 step forward (orthogonal) or 1 step in any of 4 diagonal directions (5 directions total). - `Ses`: Knight leap (identical to standard chess). - `Touk`: Unbounded orthogonal movement (identical to chess rook). - `Trey`: Moves 1 step forward orthogonally; captures 1 step forward diagonally. - `Trey Bak`: Promoted upon reaching opponent's Trey line (Rank 6 for White, Rank 3 for Black); moves identically to `Neang` (1 diagonal step). R4. Check and Checkmate: - An agent may not make a move that leaves their own `Ang` under direct attack. - Checkmate occurs when an `Ang` is in check and has no legal escape moves. Attacking agent wins immediately. R5. Endgame Counting Rules (*Kar Reab*): - When a defending player's forces are reduced to a bare `Ang` and all pawns are gone/promoted, the countdown starts based on the attacker's strongest pieces: - 2 Touk: 8 moves; 1 Touk: 16 moves; 2 Koul: 22 moves; 2 Ses: 32 moves; 1 Koul: 44 moves; 1 Ses: 64 moves. - If mate is not delivered within the allotted moves, the game ends in an immediate draw. R6. [gap-fill] Standardized Draw Conditions: - Stalemate (no legal move and not in check). - Threefold repetition of exact board position and side to move. - 64-move rule without capture or pawn promotion. ## Edge cases - **Tie at the end condition:** Draw declared under stalemate, 64-move rule, threefold repetition, or expiry of the *Kar Reab* count (R5, R6). - **A player with no legal move:** If not in check, stalemate = draw; if in check, checkmate = loss. - **Repetition / cycles (and the loop-breaking rule):** Explicitly broken by the threefold repetition rule and 64-move countdown (R6). - **Simultaneous claims on the same resource or position:** Not applicable — turns are strictly sequential. - **Player elimination mid-round; turn order repair:** 2-player game; game ends immediately on checkmate or resignation. - **Resource exhaustion:** Pieces are captured and removed; piece count is strictly bounded ≤32. - **Termination guarantee: why the game provably ends:** Guaranteed by finite piece count, 64-move rule, and *Kar Reab* countdown. ## State representation - `board`: 64-element array of piece types (13 possible piece IDs: `EMPTY`, `W_ANG`, `W_NEANG`, `W_KOUL`, `W_SES`, `W_TOUK`, `W_TREY`, `W_TREY_BAK`, and Black equivalents). - `active_turn`: ∈{WHITE,BLACK}. - `has_moved_ang`: boolean per player. - `has_moved_neang`: boolean per player. - `halfmove_clock`: integer for 64-move rule. - `reab_ang_counter`: integer count down for lone King endgame. - Observable information: Fully observable by both agents. ## Action space - `move(from_sq, to_sq)`: parameterized by start square 0..63 and destination square 0..63. ## Playability notes - **Single-player-vs-AI:** Directly compatible with chess engine architectures (Alpha-Beta, Minimax, MCTS). - **Group games (n>4):** Not applicable; inherently a 2-player duel. - **What is lost:** Nothing — discrete full-information board game formalized with 100% fidelity. ## Implementation hints Direct drop-in for standard chess bitboard representation (e.g. PyChess/Stockfish-like engine adapted for Ouk Chaktrang move generators and Rank 6 promotion rules). Branching factor is ~25–35 moves per turn, slightly lower than international chess due to shorter-range pieces.

Download as JSON

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

Download JSON
Cite this page

Ouk Chaktrang (Cambodia). (n.d.). Games of Countries. https://gamesofcountries.com/games/kh-cambodia/ouk-chaktrang

@misc{gamesofcountries-kh-cambodia-ouk-chaktrang,
  title = {Ouk Chaktrang (Cambodia)},
  year = {n.d.},
  publisher = {Games of Countries},
  url = {https://gamesofcountries.com/games/kh-cambodia/ouk-chaktrang}
}