Formal Specification
Art and Folk Card Game of Bài Chòi — Formal Specification
Vietnam · card · Confidence: high
← Back to game pageImplementation Suitability
Suitability: engine-readyFidelity: directGap-fills: 4
# Bài Chòi — AI-optimized specification
## General idea
Bài Chòi is a communal lottery and pattern-matching card game from Central Vietnam where players occupy individual watchtower huts and hold wooden paddles inscribed with three distinct folk card names. A central caller draws sticks without replacement from a 30-card traditional deck and chants poetic riddles, and players match drawn items against their held hands. The first player to match all three cards on their paddle achieves "Tới" (victory).
## Formal model
- **Abstraction taken:** The musical performance and poetic riddle improvisation (*hô thai*) are abstracted to discrete string/ID reveals from a randomized draw pool; the card-matching, token-awarding, and victory mechanics are modeled directly.
- **Player/agent count:** 9 to 11 player agents (each representing a hut/paddle), plus 1 host/caller engine.
- **Turn model:** Sequential draw rounds driven by the host; simultaneous response/claim phase for player agents holding matching cards.
## Formal rules
R1. Setup:
- The deck consists of 30 unique card identifiers (divided into three suits: *Văn*, *Vạn*, *Sách*, 10 ranks each).
- A central draw pool container is initialized with all 30 unique card tokens.
- Each player agent () is dealt a hand of exactly 3 distinct cards uniformly at random [gap-fill: hand generation ensures no duplicate cards within a single hand; multiple players may hold overlapping cards across different hands].
- Each player starts with a matched flag counter .
R2. Draw and Chant Phase:
- On each round, the host draws one card token uniformly at random from the remaining draw pool without replacement: .
- The drawn card is broadcast to all player agents.
R3. Claim and Verification:
- Every player agent checks if .
- If , player automatically registers a claim (`strike_clapper`), incrementing their flag count: .
- The host validates that indeed exists in .
R4. Victory Condition:
- If any player agent reaches , that agent triggers `claim_toi()` and wins the game immediately.
- The game halts upon the first round in which one or more agents reach .
R5. [gap-fill] Simultaneous Victory Resolution:
- If multiple player agents reach on the exact same card draw , the tie is resolved as a joint victory (shared prize), or broken by a single tie-breaker sudden-death draw where the first tied agent whose remaining undrawn card appears wins.
R6. [gap-fill] Round Limit and Stalemate Resolution:
- If the draw pool becomes empty before any player achieves , the agent(s) with the highest score win; if tied, the game is declared a draw.
## Edge cases
- Tie at the end condition: Covered by R5; simultaneous claims on the third card share the victory or resolve via sudden-death draw.
- A player with no legal move: Not applicable; matching is reactive and automatic upon receipt of broadcast .
- Repetition / cycles: Impossible because cards are drawn strictly without replacement from a finite pool of 30 cards.
- Simultaneous claims on the same resource or position: When a drawn card appears in multiple players' hands, all eligible players simultaneously receive +1 flag; there is no exclusivity on intermediate flags.
- Player elimination mid-round; turn order repair: No player is eliminated mid-round; all agents remain active until a win condition is achieved.
- Resource exhaustion: The draw pool contains 30 cards; bounded by at most 30 draw steps. Handled by R6 if no player reaches 3 flags before exhaustion.
- Termination guarantee: why the game provably ends: The draw pool decreases by 1 card per round . The game must terminate in at most 30 rounds.
## State representation
- Persistent state:
- `draw_pool`: set of remaining card IDs (initially size 30).
- `drawn_history`: ordered list of revealed card IDs.
- `player_hands`: array of size , each containing a set of 3 card IDs.
- `player_flags`: array of size , integers in range .
- `game_status`: enum `{SETUP, IN_PROGRESS, FINISHED}`.
- `winners`: list of winning player IDs.
- Per-round ephemeral state:
- `current_drawn_card`: card ID drawn in current round.
- `round_claimants`: list of player IDs claiming the match.
- Observable information:
- Public: `drawn_history`, `current_drawn_card`, `player_flags` for all players, number of remaining cards in `draw_pool`.
- Private: `player_hands[i]` is privately known to player until confirmed by claims [gap-fill: in traditional open festival play, paddles are publicly visible, so full information is also valid].
## Action space
- `host_draw()`: Draws next card from (host agent only).
- `claim_match(card_id)`: Player asserts holding to gain +1 flag.
- `claim_toi()`: Player asserts victory upon reaching 3 flags.
## Playability notes
- Single-player-vs-AI: Natural; 1 human player occupying 1 hut against AI huts and an automated dealer.
- Group games (n>4): The standard game natively supports 9 to 11 players. To reduce to a 2-agent form, deal 3 cards each to 2 agents from the 30-card deck; the race dynamic is preserved identically.
- Physical-skill games: Not applicable; pure lottery and pattern matching.
- What is lost in the adaptation: The rich oral poetry, musical improvisation, theatrical humor, and festive call-and-response ambiance of the master singer (*Anh/Chị Hiệu*) are entirely abstracted away.
## Implementation hints
- Very low computational complexity ( state update per draw).
- Represent deck as an array of integer IDs .
- Suggested first milestone: Implement the 30-card draw loop with 10 simulated agents holding 3 cards, verifying termination within rounds.
Download as JSON
Download the full game corpus entry for this game as structured JSON.
Download JSONCite this page
Art and Folk Card Game of Bài Chòi (Vietnam). (n.d.). Games of Countries. https://gamesofcountries.com/games/vn-vietnam/bai-choi
@misc{gamesofcountries-vn-vietnam-bai-choi,
title = {Art and Folk Card Game of Bài Chòi (Vietnam)},
year = {n.d.},
publisher = {Games of Countries},
url = {https://gamesofcountries.com/games/vn-vietnam/bai-choi}
}