Formal Specification
Thai Chess — Formal Specification
Thailand · board-abstract · Confidence: low
← Back to game pageImplementation Suitability
Suitability: engine-readyFidelity: directGap-fills: 2
# Makruk Thai — AI-optimized specification
## General idea
The classical two-player abstract strategy board game of Thailand, descended from ancient *chaturanga*. Played on an uncheckered 8x8 grid with 16 pieces per player, Makruk Thai features distinctive pieces including the *Khon* (noble), *Met* (minister), *Ruea* (boat), and *Bia* (pawn) deploying on the 3rd and 6th ranks. The game emphasizes positional endurance, pawn promotion to *Bia Ngoi*, and intricate codified endgame draw-counting rules (*Nab Kradan* and *Nab Sak*).
## Formal model
- **Abstraction taken:** None; the game is natively a complete, discrete, deterministic abstract board game.
- **Player/agent count:** 2 players (White and Black).
- **Turn model:** Strictly sequential, alternating turns starting with White.
## Formal rules
R1. Board and Setup:
- Played on an 8x8 uncheckered board (64 identical squares, ranks 1–8, files a–h).
- White pieces on rank 1: `a1: Ruea, b1: Ma, c1: Khon, d1: Met, e1: Khun, f1: Khon, g1: Ma, h1: Ruea`.
- Black pieces on rank 8: `a8: Ruea, b8: Ma, c8: Khon, d8: Khun, e8: Met, f8: Khon, g8: Ma, h8: Ruea` (both Khun face each other).
- Pawns (*Bia*): White places 8 Bia on rank 3; Black places 8 Bia on rank 6.
R2. Piece Movement and Captures:
- *Khun* (King): Moves 1 square in any of the 8 orthogonal or diagonal directions.
- *Met* (Minister): Moves 1 square diagonally in 4 directions.
- *Khon* (Noble): Moves 1 square diagonally in 4 directions or 1 square straight forward (5 legal directions total).
- *Ma* (Horse): Moves in an "L-shape" (2 squares in one orthogonal direction, then 1 square perpendicular); leaps over any intervening pieces.
- *Ruea* (Boat): Moves any number of unoccupied squares orthogonally (horizontally or vertically).
- *Bia* (Pawn): Moves 1 square straight forward without capturing. Captures 1 square diagonally forward.
R3. Promotion: When a *Bia* advances to the opponent's pawn start rank (rank 6 for White, rank 3 for Black), it immediately promotes to a *Bia Ngoi*, moving and capturing identically to a *Met*.
R4. Special Restrictions: No castling, no initial double-step for pawns, and no *en passant* capture.
R5. Check and Checkmate: A player's *Khun* cannot be moved into check. If a *Khun* is in check and no legal move can escape check, the attacking player wins by Checkmate (*Ruk Jon*).
R6. Stalemate: If a player on their turn has no legal moves and their *Khun* is NOT in check, the game is a draw (*Samoe*).
R7. Endgame Counting Rules (Draw Claims):
- **Board Count (*Nab Kradan*):** If neither player has any unpromoted *Bia* on the board, either player may declare a board count of 64 half-moves. If checkmate is not achieved within 64 moves, the game is a draw.
- **Piece Count (*Nab Sak*):** When a defending player is reduced to a lone *Khun*, they declare a Piece Count based on the attacking piece configuration:
- 2 Ruea: 8 moves; 1 Ruea: 16 moves; 2 Khon: 22 moves; 2 Ma: 32 moves; 1 Khon: 44 moves; 1 Ma: 64 moves; Met/Bia Ngoi only: 64 moves.
- The starting count is set to: `Threshold - Total_Pieces_Remaining_On_Board`. The defender increments the count by 1 each turn. If the count reaches the threshold before checkmate is delivered, the game is drawn.
R8. [gap-fill] Threefold Repetition: If an identical board state (same piece layout, active player, and legal moves) repeats 3 times, either player may claim a draw.
R9. [gap-fill] Hard Move Limit: As a safety fallback, if 300 moves elapse without checkmate, the game terminates as a draw.
## Edge cases
- Tie at the end condition: The game ends in a draw (*Samoe*) upon stalemate, threefold repetition, Nab Kradan (64 moves), Nab Sak (piece count threshold reached), or mutual agreement.
- A player with no legal move: If Khun is under attack: checkmate (loss); if Khun is not under attack: stalemate (draw per R6).
- Repetition / cycles: Bounded by R8 (threefold repetition) and the strict countdown clocks of R7 (Nab Kradan / Nab Sak).
- Simultaneous claims on the same resource or position: Not applicable; turns are strictly sequential, and landing on an occupied friendly square is illegal.
- Player elimination mid-round; turn order repair: 2-player game; ends immediately upon checkmate, resignation, or draw declaration.
- Resource exhaustion: Pieces are captured and permanently removed from the board; unpromoted pawns strictly advance and promote to Bia Ngoi.
- Termination guarantee: why the game provably ends: Pawn advancement and piece captures are irreversible; once pawn moves cease, Nab Kradan (64 moves), Nab Sak, and the 300-move rule provably guarantee finite game length.
## State representation
- Persistent state:
- `board[64]`: array representing the 64 squares with piece type and color.
- `active_player`: `White | Black`
- `unpromoted_pawns_count`: integer
- `nab_kradan_count`: optional integer in `[0, 64]`
- `nab_sak_count`: optional integer with target threshold
- `halfmove_clock`: integer
- `position_history`: hash map of board positions to occurrence counts
- Per-turn ephemeral state:
- `legal_moves`: list of valid legal move descriptors for active player.
- Observable information: Fully observable public state (perfect-information abstract strategy game).
## Action space
- `move(from_square, to_square)`: Standard piece movement or capture.
- `claim_draw_repetition()`: Claim draw upon 3rd repetition.
- `claim_draw_nab_kradan()`: Claim draw when 64-move board count is reached.
- `claim_draw_nab_sak()`: Claim draw when piece count threshold is reached.
## Playability notes
- Single-player-vs-AI: Ideal for classic chess-style AI engines (alpha-beta pruning, bitboards, NNUE, or MCTS); Makruk engines are well-documented and display deep positional maneuvering.
- Group games (n>4): Not applicable; strictly a 2-player duel.
- Physical-skill games: None; pure discrete strategy.
- What is lost in the adaptation: None; the traditional rules are completely captured by the discrete state machine.
## Implementation hints
- Implement board representation with standard 8x8 0x88 or 64-bit bitboards.
- Note the pawn start ranks: White pawns on rank 3 (indices 16–23), Black pawns on rank 6 (indices 40–47), with promotions occurring on ranks 6 and 3 respectively.
- Suggested first milestone: Implement legal move generation for all 6 piece types and verify promotion and check detection against standard Makruk test suites.
Download as JSON
Download the full game corpus entry for this game as structured JSON.
Download JSONCite this page
Makruk Thai (Thailand). (n.d.). Games of Countries. https://gamesofcountries.com/games/th-thailand/makruk-thai
@misc{gamesofcountries-th-thailand-makruk-thai,
title = {Makruk Thai (Thailand)},
year = {n.d.},
publisher = {Games of Countries},
url = {https://gamesofcountries.com/games/th-thailand/makruk-thai}
}