What it does
You create a table with createBlackjack, then send it actions: bet, hit, stand, double, split,
surrender, insure and decline-insurance. Each one is checked against the rules first. An accepted action
returns a list of public events (a card dealt, the hole card revealed, an action taken, the round settled), and a
refused one returns a reason and changes nothing at all. preview explains why an action would be refused without
trying it, and legalActions lists what the player may do now, so your buttons can enable and disable themselves
from the rules. When the player's hands are finished, the dealer plays out on its own.
The table keeps the secrets a real one keeps. Its observation is the player's view: the hole card is null until
it is revealed, and the shoe order and seed are never in it. The deal events hide the hole card too. The built-in
hint reads only that view, so advice can never peek at the next card.
A table records its options and the actions accepted, and nothing else. snapshot and restore rebuild every deal,
wager and settlement from those, and an edited or invalid history is refused whole. That gives you saved games,
replays and a restart from the same seed with no extra work.
Features
- Seeded shoes — one to eight standard decks shuffled from a seed, reshuffled only between rounds at the cut reserve, never during a player's decision.
- The full set of plays — hit, stand, double, split up to four hands, insurance against an ace and optional late surrender.
- Exact settlement — naturals pay 3:2, wins 1:1 and ties return the wager; bets are even whole chips so every half-bet and 3:2 payout stays exact.
- Hidden information — the player's view and the deal events never show the hole card before it is turned, nor the shoe or the seed.
- Checked actions — every action is accepted whole or refused with a reason, and
previewtells you which before you try. - Ace-aware totals —
blackjackTotalgives the soft or hard total of any cards and spots a natural. - A hint — basic-strategy-style advice from the visible cards, with the reason for it in words.
- Replay and restore — a round rebuilds from its options and actions, for saves, replays and restarts.
Good for
- A short blackjack game or a practice table where the player learns the plays.
- A casino minigame inside a larger game, such as a tavern table in an RPG, played for the game's own chips.
- Card-game collections that want a second table beside a patience game, sharing the same deck and card art.
- Teaching tools that show a hint and its reason for every hand.
- Bots and tests, which can play many hands headless from a seed.
Make it yours
The house rules are options on the table. You choose the number of decks (one to eight, six by default), the starting bankroll (200 by default), whether the dealer hits soft 17, whether a split hand may double, how many hands a split may make (two to four), whether insurance is offered and whether late surrender is allowed.
Two quite different tables: a single-deck game where the dealer hits soft 17, splits stop at two hands, there is no insurance and the shoe is reshuffled every round; and a six-deck shoe with doubling after a split, up to four hands, insurance and late surrender. Because the rules draw nothing, the same table can sit behind 3D cards that glide and flip or a flat 2D layout.
A quick look
A seeded six-deck table, a bet, and the hint's suggested play:
const table = game.blackjack.createBlackjack({ seed: 29, decks: 6 });
table.apply({ kind: 'bet', amount: 10 });
const visible = table.observation();
const advice = game.blackjack.blackjackHint(visible);
if (advice.action) table.apply(advice.action);
Works with
cards— required: the deck and shuffle the shoe is built from.card-art— card faces and backs painted with no image files.card-motion— cards that glide, flip and deal, for presenting the events.solitaire— for patience games rather than a dealer table.
Good to know
- One player seat against the house. There are no side bets and no real-money wagering: chips are play money.
- The rules are the US hole-card game, where the dealer checks for blackjack before you can split or double; the European no-hole-card settlement is not offered.
- The hint is a heuristic from the visible cards, not a perfect strategy for every set of house rules, and there is no card-counting advice.
- A snapshot contains the seed, which can reconstruct future cards, so keep it away from the player's view; an undo can only be a practice undo, since a card once seen cannot be forgotten.
- Histories are capped at 10,000 actions and a bankroll at 1,000,000,000 chips.






