Play / drillopens the full-screen table

§the engine

The engine builds a shoe, deals, and adjudicates a full hand — hit, stand, double, split, surrender, insurance, dealer hole-card and peek — with the dealer's drawing rule (hit or stand on soft 17) as a swappable strategy. The table under test here is Vegas rules: dealer hits soft 17, double after split, split aces draw one card, no resplit aces, no surrender. The React front-end is a thin adapter over that engine — it just subscribes to engine state and renders it, so the game you play and the strategy the math evaluates are the exact same code.

§proving the strategy

The interesting problem isn't playing a hand — it's knowing a basic-strategy chart is actually optimal. I check it two independent ways that have to agree:

An exact enumerator: composition-tracking, zero variance. It walks every dealer outcome against the precise remaining-deck composition to get stand / hit / double EVs to the last decimal.

A Monte-Carlo simulator: it plays a whole strategy through the real engine over shuffled shoes and reads back the mean payout, with a standard error. Same questions, completely different method.

When the simulator's measured payout lands on the enumerator's exact EV within its error bars, both are trustworthy. One is math; the other is a witness.

§a result — strategy drifts with deck count

Basic strategy gets taught as one fixed chart, but the right play depends on how many decks are in the shoe. Running the exact enumerator across deck counts (dealer stands on soft 17, non-pair hands vs up-cards 2–9), 9 of 120 cells actually change. Every place the correct action shifts:

hand1 dk2 dk4 dk6 dk8 dk
hard 9 vs 2DDDDHHHH
hard 12 vs 4HHHHSS
hard 12 vs 6HSSSSS
hard 13 vs 2HSSSSS
soft 13 vs 4DDHHHHH
soft 13 vs 5DDDDDDDDDDH
soft 14 vs 4DDHHHHH
soft 15 vs 4DDDDDDDDDDH
soft 17 vs 2DDHHHHH

DD double · H hit · S stand — e.g. 12 vs 6 flips from hit to stand once you go past a single deck; soft 15 vs 4 doubles all the way until the shoe is effectively infinite.

back to projects