Skip to main content
Formal Specification

Chinese Thirteen Cards (Hong Kong 13 Cards / Pusoy) — Formal Specification

Hong Kong · card · Confidence: low

← Back to game page

Implementation Suitability

Suitability: engine-readyFidelity: directGap-fills: 4
# Sap Saam Zoeng — AI-optimized specification ## General idea A simultaneous combinatorial card partitioning and showdown game based on Hong Kong *Sap Saam Zoeng* (Chinese Thirteen Cards / Pusoy). Four players receive 13 cards each from a standard 52-card deck and must arrange them into three poker hands (Front: 3 cards, Middle: 5 cards, Back: 5 cards) satisfying a strict ascending hierarchy (Back≥Middle≥Front), comparing corresponding hands head-to-head across all opponents to score sweeps and special bonuses. ## Formal model - **Abstraction taken:** None required. The 52-card deck, card combinations, partition constraints, and pairwise showdown scoring form a direct discrete mathematical model. - **Player/agent count:** 4 players (Player 0, 1, 2, 3). - **Turn model:** Two-phase rounds: (1) Simultaneous private hand setting, (2) Deterministic showdown and settlement. ## Formal rules R1. **Dealing:** A standard 52-card deck is shuffled and dealt equally: 13 cards to each of the 4 players. R2. **Hand Partitioning:** Each player must partition their 13 cards into three disjoint hands: - *Front Hand (HF):* 3 cards. - *Middle Hand (HM):* 5 cards. - *Back Hand (HB):* 5 cards. R3. **Ascending Hierarchy Constraint (長幼有序):** - The strength of hands must satisfy: Rank(HB)≥Rank(HM)≥Rank(HF). - Standard 5-card ranking: High Card < One Pair < Two Pair < Three of a Kind < Straight < Flush < Full House < Four of a Kind < Straight Flush < Royal Flush. - 3-card Front ranking: High Card < One Pair < Three of a Kind (straights and flushes do not exist for 3 cards). R4. **Foul Declaration (倒水 / 擺錯牌):** If a player sets a hand where Rank(HF)>Rank(HM) or Rank(HM)>Rank(HB), that player's hand is ruled a *Foul*. The fouling player loses all segments against all non-fouling opponents. R5. **Pairwise Showdown:** For every pair of players (i,j): - Compare HF(i) vs HF(j), HM(i) vs HM(j), HB(i) vs HB(j) (+1 pt for win, -1 pt for loss, 0 for tie). - **Gunshot / Sweep (打槍):** If player i wins all 3 hands against player j, the net score between i and j is doubled (+6 points instead of +3). R6. **Grand Slam (全壘打):** If a player sweeps all other 3 players in the match, their total winnings from all opponents are doubled again. R7. [gap-fill] Front 3-card ranking strictly recognizes High Card, One Pair, and Three of a Kind. Suit comparison uses Spade > Heart > Club > Diamond for identical numerical ranks. R8. [gap-fill] Foul penalty point settlement: A fouling player pays 6 base points to each non-fouled opponent. If all 4 players foul, round is a 0-point push. R9. [gap-fill] Natural Special Hands (*Lai Pai*): A dealt 13-card hand containing a Dragon (A,2,3,…,K) automatically scores +36 points from all opponents without segment comparison; 6 Pairs scores +18 points. R10. [gap-fill] Tournament structure: A standard match consists of 8 consecutive rounds (R=8 deals); player with highest cumulative points wins the match. ## Edge cases - **Tie at the end condition:** If players have identical point totals after 8 rounds, tie is broken by the player with the single highest-scoring individual round. - **A player with no legal move:** Any dealt 13-card hand has at least one mathematically valid partition satisfying HB≥HM≥HF. - **Repetition / cycles:** Fixed round horizon R=8 strictly bounds match duration. - **Simultaneous claims on the same resource or position:** Pairwise scoring is independent and symmetric across all 6 pairings (42). - **Player elimination mid-round:** Not applicable (all 4 players score simultaneously). - **Resource exhaustion:** Full 52-card deck is completely dealt each round. - **Termination guarantee:** Guaranteed by finite round sequence R∈[1,8] with finite card combinations. ## State representation - **Persistent state:** `scores: List[int]`, `current_round: int`, `round_limit: 8`. - **Per-player state:** - `dealt_cards: List[Card]` (13 cards, hidden during setting) - `arranged_hand: Tuple[List[Card], List[Card], List[Card]]` (Front, Middle, Back) - `is_fouled: bool` - `natural_special: Optional[str]` - **Per-turn ephemeral state:** - `dealt_hands: List[List[Card]]` - `round_pairwise_matrix: Array[4x4, int]` - **Observable information:** Imperfect information during setting phase (only own 13 cards visible). Fully observable during showdown. ## Action space - `arrange_hand(front_cards, middle_cards, back_cards)`: Parameters: partition of 13 cards into lists of lengths 3, 5, 5. Preconditions: agent holds the 13 cards. - `declare_natural_special(type)`: Parameters: `type in {DRAGON, SIX_PAIRS, THREE_FLUSHES}`. Preconditions: dealt hand satisfies special combination requirements. ## Playability notes - **Single-player-vs-AI:** Highly playable. Hand arrangement is a constrained combinatorial optimization problem ((135)×(85)=1,287×56=72,072 possible partitions per deal). - **Group games (n>4):** Strictly 4 players. Can be played with 2 or 3 players by dealing 13 cards each and discarding remaining cards. - **Physical-skill games:** Pure discrete card logic; no physical dexterity. - **What is lost in the adaptation:** Physical card sorting in hand, suspense of revealing hands one segment at a time with verbal declarations, and festive banter. ## Implementation hints - Partition search space: Evaluating all 72,072 hand arrangements takes <5 milliseconds in compiled languages. - AI evaluator: Score each candidate partition by estimated expected value against random/modeled opponent hand distributions. - First milestone: Headless 4-agent hand partitioner with poker hand evaluator verifying ascending rule constraint and gunshot doubling calculations.

Download as JSON

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

Download JSON
Cite this page

Chinese Thirteen Cards (Hong Kong 13 Cards / Pusoy) (Hong Kong). (n.d.). Games of Countries. https://gamesofcountries.com/games/hk-hong-kong/sap-saam-zoeng

@misc{gamesofcountries-hk-hong-kong-sap-saam-zoeng,
  title = {Chinese Thirteen Cards (Hong Kong 13 Cards / Pusoy) (Hong Kong)},
  year = {n.d.},
  publisher = {Games of Countries},
  url = {https://gamesofcountries.com/games/hk-hong-kong/sap-saam-zoeng}
}