Skip to main content
Formal Specification

Thai Jacks — Formal Specification

Thailand · dexterity-small · Confidence: low

← Back to game page

Implementation Suitability

Suitability: adaptation-requiredFidelity: probabilistic-proxyGap-fills: 4
# Mak Kep — AI-optimized specification ## General idea A traditional Thai jacks and hand-eye dexterity game played with five small rounded pebbles. A player scatters the stones on the floor and progresses through four sequential stages (Mak 1: scoop 1-by-1; Mak 2: scoop pairs; Mak 3: scoop 1 then 3; Mak 4: place all 4 and sweep all 4) while tossing and catching a designated toss-stone (*Luk Nam*), followed by a final point-scoring flip catch on the back of the hand (*Tang Ran*). ## Formal model - **Abstraction taken:** Physical hand tosses, aerial reaction times, and tactile pebble gathering without grazing adjacent stones are modeled via a 2D spatial coordinate scatter generator and parameterized stochastic success functions `P(clean_catch)` and `P(graze_fault)`. - **Player/agent count:** 2 to 5 players (commonly 2 to 4). - **Turn model:** Sequential player turns; an active player continues playing until a fault ("death") occurs, at which point state is saved and the turn rotates. ## Formal rules R1. Equipment and Turn Order: Played with 5 identical stones. Turn order is determined at match start via *Khuen Ran* (tossing 5 stones and catching on the back of the hand; highest catch count takes first turn). R2. [gap-fill] Stage Progression Structure: A full game consists of 4 main stages (Mak 1, Mak 2, Mak 3, Mak 4) followed by the score-generating phase (*Tang Ran*): - **Mak 1:** Scatter 5 stones, select 1 as *Luk Nam*. In 4 successive tosses, collect the remaining 4 stones one by one. - **Mak 2:** Scatter 5 stones, select 1 as *Luk Nam*. In 2 successive tosses, collect the remaining 4 stones in groups of 2. - **Mak 3:** Scatter 5 stones, select 1 as *Luk Nam*. In 2 successive tosses, collect 1 stone then the remaining 3 stones (or 3 then 1). - **Mak 4:** Hold all 5 stones in hand; toss *Luk Nam*, place all 4 stones on the floor, catch *Luk Nam*; toss *Luk Nam* again, sweep up all 4 stones simultaneously, and catch *Luk Nam*. R3. [gap-fill] Execution & Foul Resolution: - On each pick-up attempt, the player selects which subset of stones to target. - Difficulty is computed based on distance between target stones and non-target stones: `P(fault) = f(Min_Distance_To_Other_Stones, Dexterity_Skill)`. - Catch success: `P(catch) = f(Toss_Height, Dexterity_Skill)`. - If a fault occurs (dropping *Luk Nam*, failing to scoop the exact required count, or grazing an adjacent stone), the player's turn ends immediately ("dies"). The player's stage and sub-step index are preserved for their next turn. R4. [gap-fill] Scoring Phase (*Tang Ran*): - Upon completing Mak 4, the player performs *Tang Ran*: tosses all 5 stones from the palm, catches `C` stones on the back of the hand (`C in [0, 5]`), tosses them again, and snatches them in the palm. - Points scored for that successful run = `C * 10` points. - After *Tang Ran*, the player resets to Mak 1 and may continue their turn to accumulate additional points until a fault occurs. R5. [gap-fill] Victory Condition: The first player to reach or exceed a target score of `100 points` wins the match. ## Edge cases - Tie at the end condition: The first player to reach or exceed 100 points on their turn wins immediately; if multiple players reach the threshold in the same rotation, the player with the highest total score wins; exact ties share victory. - A player with no legal move: Not applicable; active player always executes the throw/scoop action appropriate to their saved stage state. - Repetition / cycles: Bounded by monotonic point accumulation toward the 100-point ceiling. - Simultaneous claims on the same resource or position: Not applicable; turns are strictly sequential, and players share the same physical pool of 5 stones. - Player elimination mid-round; turn order repair: On a fault ("death"), the active player's turn terminates immediately, and turn passes to `(current_player_index + 1) mod N`; no players are eliminated, only rotated. - Resource exhaustion: The 5 stone tokens are conserved indefinitely across all turns and resets. - Termination guarantee: why the game provably ends: Because skilled agents have a strictly positive probability of completing stages and scoring non-zero points on *Tang Ran*, the cumulative score is monotonically non-decreasing and hits 100 points in finite expected turns. ## State representation - Persistent state: - `player_scores[N]`: integer array of points - `player_stages[N]`: integer array `[1..4]` tracking current stage (Mak 1..4) - `player_substeps[N]`: integer tracking completed scoops in current stage - `active_player`: integer in `[0, N-1]` - `target_score`: integer (default 100) - Per-turn ephemeral state: - `stone_positions[5]`: 2D coordinates `(x, y)` on the 1x1m floor surface - `toss_stone_id`: index of active *Luk Nam* - Observable information: Fully observable public state (all stone coordinates, player stages, and score tallies are visible to all agents). ## Action space - `scatter_and_select(toss_id)`: Drop stones onto 2D surface and declare *Luk Nam*. - `attempt_scoop(target_stone_ids)`: Attempt to collect designated stone indices while tossing *Luk Nam*. - `execute_mak4_drop_and_sweep()`: Execute the two-part drop and full scoop for Mak 4. - `execute_tang_ran()`: Perform the back-of-hand toss-catch scoring flip. ## Playability notes - Single-player-vs-AI: Highly natural turn-based dexterity challenge; AI evaluates optimal stone scatterings and picks the safest stone cluster combinations to minimize graze risk. - Group games (n>4): Supports 2 to 5 players seamlessly with round-robin turn passing. - Physical-skill games: Finger dexterity, palm-to-back-of-hand catching, and fine motor precision are abstracted via the spatial proximity graph and stochastic catch/graze models. - What is lost in the adaptation: The auditory clicking of smooth river pebbles against floor tiles and the physical tension of delicate finger gymnastics. ## Implementation hints - Model the playing surface as a 2D bounding box `[0.0, 1.0] x [0.0, 1.0]`. - Graze probability can be computed using minimum Euclidean distance between the convex hull of chosen target stones and remaining static stones. - Suggested first milestone: Implement the 4-stage sequential state machine and verify fault transitions and *Tang Ran* score increments with a uniform random outcome generator.

Download as JSON

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

Download JSON
Cite this page

Thai Jacks (Thailand). (n.d.). Games of Countries. https://gamesofcountries.com/games/th-thailand/mak-kep

@misc{gamesofcountries-th-thailand-mak-kep,
  title = {Thai Jacks (Thailand)},
  year = {n.d.},
  publisher = {Games of Countries},
  url = {https://gamesofcountries.com/games/th-thailand/mak-kep}
}