Poker is a game about betting. Big Two is a game about spending. Every card you put down is one you no longer have, and the whole thing comes down to knowing what a 2 is worth holding onto.
What It Is
Single-player Big Two (鋤大D), the Cantonese climbing game, against three AI opponents: Alice, Louis, and Angus. It is a React module inside the Wanessa Labs Games Hub, sharing the hub’s GameProps contract and design language. Standard 52 cards, 13 each, and whoever is dealt the 3 of diamonds leads the first trick and has to include it. First player to empty their hand wins the round. No accounts, no backend, no network calls during play.
The Rules Came First
Big Two has a small rulebook with a lot of edges, and a loose implementation gets them wrong in ways that only show up mid-game. So the engine was written and tested before any interface existed: card ordering, combination detection, comparison, legal-move generation, the trick state machine, and scoring, all as pure functions with no DOM anywhere near them.
Two rules decide whether an implementation is trustworthy:
J-Q-K-A-2is not a straight. The 2 is the highest card in the game, so it looks like it should cap the run. It does not, and there is an explicit test that rejects it.- The 2 does not form a straight at all by default, so
2-3-4-5-6is rejected for the same reason.
Ranks run 2 A K Q J 10 9 8 7 6 5 4 3 and suits run spades, hearts, clubs, diamonds. The highest card in the deck is the 2 of spades and the lowest is the 3 of diamonds. Five-card hands rank straight, flush, full house, four of a kind with a kicker, then straight flush. There is no four-card play.
Variants Built, Deliberately Not Exposed
Big Two is a game people learn at a specific table, and every table has its own version. Three variant flags are fully implemented and tested, and all three ship off:
| Flag | What it changes |
|---|---|
| Bombs beat anything | Four of a kind and straight flushes beat any lower play regardless of size |
| Low ace straight | A-2-3-4-5 counts, ranked as the highest straight, because it holds the 2 |
| Penalty multipliers | Ten or more cards left doubles the round score, thirteen triples it |
The plumbing is complete; no settings screen exposes it yet. Building the flags first means the disagreements about house rules are a toggle later rather than a rewrite.
The Coach Uses the Bots’ Brain
Same pattern as the Poker Trainer. The coach does not implement its own opinion about the game. It calls the exact function the opponents call to choose their move, then annotates the result with a headline, a one-line reason, and situational tips: you are holding the 2 of spades, you are sitting on a bomb, you have control of the trick, an opponent is nearly out. Advice and AI cannot disagree, because there is only one of them.
How the Opponents Think
The bots are a pure heuristic, a function over game state with no machine learning, deterministic given a seed, which is what makes a whole match testable with no interface at all.
Leading: go out if a play empties the hand. Otherwise shed the most low cards at once, because a low pair or a low straight beats dribbling singles one at a time, and hold high cards, 2s, and bombs in reserve. In the two-card endgame, lead the higher single first so its control lets the last low card go out uncontested.
Following: win now if a response empties the hand. Otherwise play the lowest response that wins. If only a 2 or a bomb could take a cheap pile, pass and keep it, unless the pot is big or the endgame has started.
They also talk. Each seat has its own lines for the moments that matter, throttled so the table never turns into noise.
The Hand Is Yours to Arrange
Tap a card to select it, tap again to deselect, and Play only enables when the selection is a legal combination, so the game never lets you make an illegal move and then scolds you for it. A Rank / Suit toggle regroups the hand: rank lines up pairs, triples, and straights, suit groups flushes. On top of that, any card can be dragged anywhere in the hand. The custom order survives the opponents’ turns and resets on a new deal.
How It Was Verified
- 59 tests across 6 files, covering combination classification, same-category and cross-category comparison, the trick state machine, scoring, and the bots.
- A 120-game headless simulation asserting every game reaches a winner with an empty hand, with no illegal moves and no stalls.
- A render smoke test that plays a real round through the interface.
Features
- Four-player Big Two against three named AI opponents
- Strict rules engine, including an explicit
J-Q-K-A-2rejection - A live coach that shares the bots’ decision function
- Tap to select, sort by rank or suit, and drag cards into any order you like
- Three regional variant flags implemented and tested, ready to expose
- Mid-round resume on reload, plus lifetime wins tracked on the hub
- Table talk from every seat, throttled
- Fully offline, no accounts, no network calls during play
Stack
| Tool | Role |
|---|---|
| React + TypeScript | Game module inside wanessalabs-games |
| Pure engine | DOM-free rules, comparison, and legal-move generation, seed-driven and headless-testable |
| Tailwind | Hub-consistent styling with design tokens |
| Cloudflare Pages | Hosted inside the wanessalabs-games hub |

