A full social-casino starter project
Start with Assets/CompleteCasinoKit/Scenes/Demo.unity. Use Window > Complete Casino Kit > Legacy > Classic Hub for setup checks and one-click fixes, or Window > Complete Casino Kit > Studio for the unified game workbench.
Complete Casino Kit is entertainment software. It does not include a real-money backend, cash-out, KYC, geofencing, jurisdictional compliance, hosted analytics, hosted ads, hosted leaderboards, hosted cloud saves, or platform store approval.
Quick Start
Thirty-one authored casino games, a complete meta layer, five languages, three skins, persistent settings and balances, and payout mathematics backed by the included test suite.
Quick start
- Import the package into a Unity 6000.0 or newer URP project.
- Open Window > Complete Casino Kit > Legacy > Classic Hub and use its Get Started fixes until
- Open
Assets/CompleteCasinoKit/Scenes/Demo.unityand press Play. - Use the Lobby tiles to open a game and the authored back control to return.
every row is green. (Casino Kit Studio, under Window > Complete Casino Kit > Studio, is the unified workbench; the setup checklist with one-click fixes lives in the Classic Hub.)
Guides
- Architecture
- Games and their rule documents
- Replacing art, skins, backgrounds, and audio
- Adding a game with the wizard
- Settings and persistent saves
- Analytics, ads, IAP, and leaderboard adapters
- Running validation and tests
- Publishing checklist
- Known limitations and accessibility scope
Editor tools
Everything is under Window > Complete Casino Kit. Casino Kit Studio is the unified workbench; the Hub, New Game Wizard, configuration inspectors, visual tools, localization grid, RTP simulator, round replayer, QA lab, build profiles, and release center remain available as focused workflows.
The package contains no real-money backend and must be presented as entertainment software only. External analytics, ads, IAP, leaderboards, cloud saves, consent, and account systems require the buyer's own providers and platform configuration.
Architecture
Runtime layers
| Assembly | Responsibility |
|---|---|
CasinoKit.Rules | Pure C# cards, RNG, evaluators, rules cores, and simulation. |
CasinoKit.Integrations | Provider contracts and dependency-free null implementations. |
CasinoKit.Core | Wallet, saves, session lifecycle, pooling, skin service, music, and shared events. |
CasinoKit.UI | Authored reusable UI behavior, orientation, safe area, and help. |
CasinoKit.Meta | Lobby, progression, missions, rewards, settings, and shop. |
CasinoKit.Games.* | Game-specific rules configuration, presentation, and authored table UI. |
Every game decides its complete outcome in a pure rules core before presentation begins. The table records that outcome, presentation replays it, and RoundSettlement releases the recorded payout exactly once. Disabling a table, pausing, or quitting flushes pending settlement before durable save state is written.
Scenes and prefabs are authored assets. Runtime code drives serialized references and does not build tables with object searches or mid-round instantiation. CasinoServices is the explicit replacement seam for wallet, save, localization, RNG, haptics, analytics, ads, and leaderboards.
See Settings and saves, Integrations, and Testing for the corresponding operational contracts.
Art, Skins & Audio
Processed runtime art lives below Assets/CompleteCasinoKit/Art. Production source masters are not part of the exported package. A sprite filename is its stable skin slot; replacing a file at the same path preserves every authored reference.
Safe workflow
- Open Casino Kit Studio > Visuals and scan the current slot contract.
- Match the existing pixel dimensions, transparency, border, and import type.
- Replace the processed file without changing its name.
- For a new skin, use Skin Builder and assign every required slot before applying it.
- Rebuild Backdrops after changing full-bleed art so portrait and landscape variants are wired.
- Run validation, the fast tests, and the relevant screenshot captures.
Nine-sliced UI sprites must retain usable borders. Backdrops need portrait and landscape siblings and must remain direct canvas children behind SafeArea; felt is intentionally full-bleed. Interactive UI belongs inside SafeArea.
Audio uses the same swap contract under Art/Audio: stable WAV filenames, one source per table, mechanic-specific start cues, shared result cues, and separate music_lobby_loop.wav and music_table_loop.wav. The two music slots ship silent so placeholder tones never drone during play; replace those files to add production music without changing code or prefab references.
Adding a Game
Wizard flow
- Open Window > Complete Casino Kit > New Game.
- Choose a unique snake-case id, family, display copy keys, bet limits, and assembly namespace.
- Generate the scaffold. The wizard creates a C# rules-notes file, config, definition, pure rules
- Complete the generated rules notes first: bets, state machine, exact payout equations,
- Implement and verify the pure rules core before presentation.
- Build the authored table and add localized copy in all five shipped languages.
- Re-run Banners, Audio, Backdrops, SafeArea, and Help. Wide tables also run the bespoke landscape
- Validate, run the generated smoke/math tests, capture every meaningful state, and review it.
core, table, authoring script, prefab, scene, and smoke/math test templates.
references, edge/RTP policy, and the help disclosure source. Add the final buyer-facing rule reference to the generated game section in Documentation.html before release.
pass.
Never construct the table UI at runtime. New feature analytics should call the protected TrackFeature helper with a stable snake-case detail id. The game id already becomes the save, localization, replay, and analytics identity, so changing it after release requires migration work.
Settings & Saves
Production boot uses a signed JsonFileStore at Application.persistentDataPath/casino-save.json. The neutral CasinoServices.InstallDefaults() intentionally uses memory storage so tests and preview tools cannot touch a player's file.
The saved document contains wallet balances and lifetime totals, per-game state, meta progression, missions, language, skin, music/SFX volumes, turbo default, haptics, and reduced motion. Wallet writes are debounced; pause, quit, teardown, and settlement interruption force a flush. Corrupt or interrupted writes fall back safely through the primary, temporary, and backup file recovery path.
The Lobby settings dialog writes through immediately. Music and active table SFX update live. Turbo is applied when a table starts. Reduced Motion accelerates presentation-only steps to 12x, including the kit's dice-shake and bounce pauses, while leaving outcomes and settlement untouched. Haptics goes through IHapticsProvider and defaults to a no-op; install a native provider for device patterns.
When extending SaveDocument, increment its version, add one ordered ISaveMigration, normalize new containers, and add real-file round-trip plus migration tests. Never change the in-memory default to a file store: doing so would make PlayMode tests mutate production data.
Integrations
No third-party SDK ships. Analytics, advertisements, and leaderboards are installed as null providers by default through CasinoServices; IAP remains the explicit provider on ShopPanel, whose shipped implementation is a simulation. Replace only the interface you need.
Analytics
Real call sites emit game_opened, round_settled (game, stake, return), and feature_triggered (game, stable feature id, optional value). The payload is typed and allocation-free.
public sealed class MyAnalytics : IAnalyticsProvider
{
public void Track(in AnalyticsEvent e)
{
// Translate e.Name, e.GameId, e.Detail, e.StakeCredits,
// e.ReturnedCredits and e.Value into your SDK here.
}
}
Install it with the optional analytics: argument of CasinoServices.Install. Obtain consent before installing or forwarding identifiers.
Advertisements
public sealed class MyAds : IAdsProvider
{
public bool IsInterstitialReady(string placementId) => false;
public bool IsRewardedReady(string placementId) => false;
public void ShowInterstitial(string placementId) { }
public void ShowRewarded(string placementId, System.Action<bool> done) => done(false);
}
Install with ads:. The kit deliberately has no automatic ad call site. Choose placements, cadence, consent, age-gating, and reward policy for your product; grant currency only when the callback is true.
Leaderboards
public sealed class MyLeaderboards : ILeaderboardProvider
{
public void Submit(string id, long score, System.Action<bool> done) { done(false); }
public void LoadTop(string id, int count,
System.Action<System.Collections.Generic.IReadOnlyList<LeaderboardEntry>> done)
{
done(System.Array.Empty<LeaderboardEntry>());
}
}
Install with leaderboards:. The kit deliberately submits no local wallet value: competitive scores need authenticated ownership and server validation before they are trustworthy.
IAP
public sealed class StoreIap : IIapProvider
{
public void Purchase(ShopProduct product, System.Action<bool> done)
{
// Call the store SDK, validate the receipt, then report success.
}
}
shopPanel.Provider = new StoreIap();
Never grant paid currency from a client callback without the receipt validation appropriate to your store and threat model.
Testing
The test assemblies ship with the kit. The fast matrix covers EditMode integration and PlayMode scene smokes while excluding tests marked Heavy and graphics-only screenshot captures. From an imported package, use Unity Test Runner or Casino Kit Studio > QA to run and filter the included assemblies. Heavy tests include exhaustive enumerations and multi-million-round simulations; run them before a release after any rule/config change. Screenshot tests require a graphics device and a non-headless Unity process.
Validation checks definitions, configs, localization, authored references, build scenes, skin slots, runtime-content rules, and package contracts. A green unit suite does not replace visual review: capture every panel and meaningful game state after UI, art, orientation, or safe-area changes.
Publishing
Supplied-machine build evidence
- WebGL: compile-and-build smoke succeeded; evidence log was archived by the release pass.
- Android APK: compile-and-build smoke succeeded with the installed SDK/NDK/JDK; evidence log was archived by the release pass.
- iOS and store submission: not build-verified; a Windows editor cannot produce honest iOS evidence.
- Real-device rotation, cutout, touch, haptic, suspend/resume, and performance evidence remains manual.
Automated evidence
- Validation reports zero errors.
- EditMode and PlayMode fast suites are green on every supported Unity floor.
- Heavy math is green after rule or payout changes.
- Target platform builds compile and produce an artifact.
- Buyer documentation links resolve inside
Documentation. - Package identity, version, scenes, and icons are correct for the target store.
- Export log confirms production-source art is excluded.
Manual device evidence
- Rotate through portrait, landscape-left, and landscape-right on representative phones/tablets.
- Verify notches, rounded corners, gesture bars, and touch targets in Lobby and every table family.
- Play every game, interrupt wins with home/lock/kill, and confirm wallet persistence after restart.
- Check music/SFX sliders, mute behavior, haptics, headphones, and audio interruption/resume.
- Soak touch input, back navigation, low-memory scene transitions, thermal behavior, and frame pacing.
- Verify privacy consent, age rating, analytics/ads disclosure, store receipts, and regional policy for
every external SDK you add.
Do not claim device or store evidence that was not actually reproduced. Record untested platforms and remaining manual checks in the release notes.
Known Limits
Content scope
- Casino Hold'em uses published pre-flop/flop simplifications; its river decision is exact.
- Roulette's authored zero row omits the zero-adjacent splits, trio, and basket tap zones.
- Pai Gow Fortune has no envy payout because the shipped table is single-seat.
- The ways feature-buy return differs from the base game because whole-credit pricing quantises it.
- Cluster gem-meter and baccarat-road progress are session state, not saved state.
- Five wide tables have bespoke landscape reflows; other games use a contained aspect fit.
Storage differs by platform, on purpose
CasinoBootstrap.DefaultStore() picks the store for the platform, and both write the same signed payload:
- Windows, macOS, Linux, Android, iOS —
JsonFileStore, an atomically written, integrity - WebGL —
PlayerPrefsSaveStore. Unity mountspersistentDataPathas an in-memory
hashed JSON file under Application.persistentDataPath, with a last-good backup.
filesystem on WebGL, so a file written there is lost on page reload unless the page calls FS.syncfs; a .jslib bridge that drove that sync was built, tested and rejected because it hung the browser tab. PlayerPrefs is the storage Unity persists itself, and the shipped WebGL build post-pass opts Unity's generated shell into autoSyncPersistentDataPath so it uses the current automatic IndexedDB path instead of deprecated manual synchronization. A browser player's balance, settings and progress survive a reload through it.
Both are ISaveStore implementations. Swap either for PlayFab, Firebase, Steam Cloud or your own backend by implementing that interface and installing it in CasinoBootstrap; nothing in game code changes. Whatever you use on WebGL, verify it by playing and reloading, not just by checking that a write returned.
Accessibility scope
Keyboard/gamepad navigation has a visible aqua focus state, automatic panel focus, and an input-only Lobby-to-table-to-wager-to-back PlayMode test. Reduced Motion accelerates presentation steps; it does not remove every semantic transition. Screen-reader metadata, dynamic text scaling, and colorblind-simulation-verified palettes are not implemented. Do not market those capabilities. The five-language tables translate shipped copy but do not imply locale-specific regulatory approval.
Platform and services
Analytics, ads, IAP, leaderboards, cloud saves, authentication, consent UI, and server-authoritative outcomes are integration seams, not hosted services. Real-device rotation, cutout, touch, haptic, and store validation remains a manual publishing responsibility.
This is entertainment software. It has no real-money gambling backend, cash-out, KYC, geofencing, or jurisdictional compliance layer.
All 31 games
Every shipped game has an authored rules reference covering flow, bets, payout math, source notes, deliberate deviations, and worked examples. Expand a game below or use the documentation search.
Cards 10 · Casual 6 · Lottery 5 · Slots 5 · Tables 5
Baccarat (Punto Banco)Cards · card_baccarat+
Family: Cards · Complexity: M · Phase 4 · Reference house edge: Banker 1.06 % · Player 1.24 % · Tie 14.36 %
Written before any code, per the Adding a Game section in this guide step 1.
1. The shipped rule set
| Rule | Shipped value |
|---|---|
| Decks | 8 |
| Card values | Ace 1, 2–9 face value, 10 and face cards 0 |
| Hand total | Sum of pips, modulo 10 |
| Banker win | 1:1 less 5 % commission (0.95:1) |
| Player win | 1:1 |
| Tie | 8:1; Player and Banker wagers push |
| Player Pair / Banker Pair | 11:1 |
The player makes no decisions. Both hands are played out by fixed rules — which is precisely why those rules have to be exactly right.
2. Drawing rules
Naturals. If either hand totals 8 or 9 on its first two cards, both stand and the hand is over.
Player. Draws on 0–5, stands on 6–7.
Banker. If the Player stood, Banker plays the same rule: draw on 0–5, stand on 6–7.
If the Player drew, Banker follows this table, where T is the Player's third card:
| Banker total | Draws when the Player's third card is |
|---|---|
| 0, 1, 2 | always |
| 3 | anything except 8 |
| 4 | 2, 3, 4, 5, 6, 7 |
| 5 | 4, 5, 6, 7 |
| 6 | 6, 7 |
| 7 | never — stands |
This table is the single most commonly mis-implemented rule set in casino software. It is not derivable from anything; it simply is what it is. Every cell is asserted individually in the tests rather than checked by a few spot examples, and the implementation is a literal transcription with the table repeated in a comment above it.
3. Why Banker is the better bet, and why it is taxed
Banker acts after Player and with knowledge of Player's third card, so it wins slightly more often — about 45.86 % of hands against 44.62 %, with 9.52 % ties. Left alone that would be a player advantage, so the house takes 5 % commission on Banker wins. That commission is the entire reason Banker is not the free lunch it looks like.
The Tie bet at 8:1 is dreadful — a 14.36 % house edge — and the help screen says so.
4. Sources consulted
- The Wizard of Odds' baccarat analysis — the 1.06 % / 1.24 % / 14.36 % house edges for
- Published Punto Banco drawing rules (casino rule sheets and Hoyle) — the natural rule, the
eight decks with 5 % Banker commission and 8:1 Tie, and the 45.86 % / 44.62 % / 9.52 % outcome frequencies. Confirms every figure this game is verified against.
Player's draw-on-0-to-5, and the Banker third-card table reproduced cell for cell in §2.
The two agree exactly. Where the Banker table is often gotten wrong is the 3 versus 8 cell and the 6 versus 6-or-7 row; both have dedicated tests.
5. Deliberate deviations
- No commission-free ("EZ") variant, where Banker pays 1:1 but a winning Banker 6 pays half.
- Tie pays 8:1, not 9:1. Both exist; 8:1 is the more common and is the figure the published
- No road maps yet (bead plate, big road, big eye boy). They are presentation over a history
Configurable later; the standard commission form ships.
edge assumes.
buffer, not rules, and belong with the table rather than the core.
6. Achieved figures
Outcome frequencies over 2,000,000 hands — the strongest evidence the drawing rules are right, because they depend on nothing but the drawing rules:
| Outcome | Measured | Published |
|---|---|---|
| Banker wins | 45.820 % | 45.86 % |
| Player wins | 44.675 % | 44.62 % |
| Tie | 9.505 % | 9.52 % |
House edges over 2,000,000 hands each:
| Bet | Measured edge | Published |
|---|---|---|
| Banker | 1.0156 % | 1.06 % |
| Player | 1.3135 % | 1.24 % |
| Tie | 14.0563 % | 14.36 % |
Banker remains the better bet even after the 5 % commission, which is the whole point of the commission existing — and that ordering is asserted, not just observed.
Matching the frequencies matters more than matching the edges. The edges follow from the frequencies plus the payout rules, so if the frequencies are right the drawing table is right; if only the edges matched, a compensating pair of errors could still be hiding in there.
7. Worked examples (become the first unit tests)
- Totals are modulo 10. 7 + 7 = 14 → 4. Ace + King = 1.
- A natural 9 stands and ends the hand immediately.
- Player 5, Banker 3, Player draws an 8 → Banker total 3 with a third card of 8 → Banker
- Player 5, Banker 3, Player draws a 7 → Banker draws.
- Banker 6, Player's third card 5 → Banker stands; a third card of 6 would make it draw.
- Banker wins with a 100 wager → returns 195 (stake plus 0.95:1, rounded down).
- A tie with 100 on Player → returns 100; the wager pushes.
stands (the one exception in the 3 row).
8. Definition of done
Tracked against the 16-point checklist in the Adding a Game section in this guide.
9. v1.1 addendum - the road maps (bead plate + big road)
Baccarat tables the world over run a scoreboard beside the shoe. The two canonical displays are shipped in v1.1, driven by a pure road-builder (BaccaratRoads) that consumes one BaccaratOutcome per resolved round and owes nothing to UnityEngine.
Sources (2):
- Wizard of Odds, "Baccarat Score Boards" - defines the bead plate and big road, tie
- Wikipedia, "Baccarat", scoreboard/roads section - corroborates the six-row grids, the
notation, and the "dragon tail" turn when a column runs into the bottom row or an occupied cell.
chronological bead plate, and the big road's new-column-on-change rule.
Bead plate (bead road). Strict chronology on a six-row grid: results fill a column top to bottom, then move one column right. Every round gets a cell - Banker, Player and Tie alike. Pair markers are omitted (deliberate deviation: single-seat table, pairs are already separate wagers with their own banner).
Big road. Six rows; only Banker/Player results occupy cells. A result on the same side as the previous one extends the current column downward; a change of side starts a new column at the top. A tie never takes a cell: it increments a counter on the most recent entry (rendered as a count beside the letter), and ties dealt before the first Banker/Player result attach to that first entry when it lands.
The dragon tail. When a column cannot grow downward - row six is full, or the cell below is occupied by an earlier column's tail - the streak turns right and continues along its row. A new column whose top cell is occupied by such a tail shifts right to the first free top cell. The worked cascade below exercises every branch and is pinned verbatim in BaccaratRoadsTests:
B7 P7 B5 P4 B3 P3 B1 (counts of consecutive same-side results) places, in order:
- B x7: (0,0)..(0,5) then tail (1,5)
- P x7: (1,0)..(1,4), blocked by (1,5), tail (2,4),(3,4)
- B x5: (2,0)..(2,3), blocked by (2,4), tail (3,3)
- P x4: (3,0)..(3,2), blocked by (3,3), tail (4,2)
- B x3: (4,0),(4,1), blocked by (4,2), tail (5,1)
- P x3: (5,0), blocked by (5,1), tail (6,0),(7,0) - a tail along the TOP row
- B x1: column 6's top cell is occupied by that tail, so the new column shifts right
past 7 (also occupied) to (8,0)
Presentation. Both grids are authored TMP cells (7 columns x 6 rows each, no runtime spawns) flanking the space between the hands; when a shoe outgrows the authored columns the view windows to the most recent seven. Roads persist across rounds for the scene's lifetime and reset with the scene, matching a physical board wiped when the table reopens.
BlackjackCards · card_blackjack+
Family: Cards · Complexity: L · Phase 2 (vertical slice) · Reference house edge: 0.40 %
Written before any code, per the Adding a Game section in this guide step 1.
1. The shipped rule set
Every one of these changes the house edge, so the set is stated exactly rather than loosely.
| Rule | Shipped value |
|---|---|
| Decks | 6 |
| Dealer on soft 17 | Stands (S17) |
| Blackjack pays | 3:2 |
| Dealer peeks for blackjack | Yes, on an Ace or a ten |
| Double | On any first two cards |
| Double after split (DAS) | Allowed |
| Split | Up to 4 hands total |
| Split aces | One card each, and may not be resplit; 21 is not a blackjack |
| Resplit aces | No |
| Surrender | Not offered |
| Insurance | Offered when the dealer shows an Ace, pays 2:1 |
| Penetration | 75 % before the cut card |
House edge for exactly this set: 0.40 % (RTP 99.60 %) against basic strategy.
The rules that matter most, in order of how much they move the edge: 6:5 blackjack instead of 3:2 costs the player about 1.39 %; H17 instead of S17 costs about 0.22 %; removing DAS costs about 0.14 %. All are exposed as configuration, and the editor tool shows the delta for each.
2. Round flow
- The player places the main wager and, optionally, the side bets.
- Two cards to the player face up, two to the dealer — one up, one down.
- Side bets resolve immediately on the initial four cards (see §4) and are then out of play.
- If the dealer's upcard is an Ace, insurance is offered for up to half the main wager.
- Dealer peek. With an Ace or a ten showing, the dealer checks the hole card. If it is a
- If the player has a natural and the dealer does not, it pays 3:2 and the hand is over.
- Otherwise the player acts on each hand in turn: hit, stand, double, split.
- When every hand is finished or bust, the dealer reveals the hole card and draws to 17, standing
- Each surviving hand is compared with the dealer's.
blackjack the round ends immediately: the main wager loses (or pushes against a player blackjack) and insurance pays 2:1. Peeking matters — without it the player can lose a doubled or split wager to a dealer blackjack, which is worth about 0.11 %.
on all 17s including soft.
3. Player actions
- Hit — take a card. Legal until the hand is 21 or bust.
- Stand — end the hand.
- Double — only on the first two cards of a hand; doubles the wager and takes exactly one card.
- Split — only on the first two cards, only when they have the same blackjack value, and only
After a split, only if DAS is enabled. Never on a split ace.
while the hand count is below the maximum. Any two ten-value cards (10/J/Q/K) may be split even when their printed ranks differ. Splitting places an equal wager on the new hand. Split aces receive one card each and cannot act further.
An action that is not legal is refused with a reason rather than throwing; the UI uses that to keep buttons disabled.
4. Side bets
Both resolve on the initial deal and are independent of the main wager.
Perfect Pairs — on the player's two cards:
| Outcome | Pays |
|---|---|
| Perfect pair (same rank and suit) | 25:1 |
| Coloured pair (same rank, same colour, different suit) | 12:1 |
| Mixed pair (same rank, different colour) | 6:1 |
21+3 — the player's two cards plus the dealer's upcard, ranked as a three-card poker hand:
| Outcome | Pays |
|---|---|
| Suited three of a kind | 100:1 |
| Straight flush | 40:1 |
| Three of a kind | 30:1 |
| Straight | 10:1 |
| Flush | 5:1 |
Both carry a far higher house edge than the main game — roughly 4 – 7 % depending on deck count. That is normal and intentional for side bets, and the help screen says so rather than hiding it.
5. Verifying the math
Blackjack's edge cannot be enumerated exactly the way a slot's can: the shoe carries state between hands, so the outcome space is astronomically large. It is instead measured by simulating a fixed, published strategy and comparing the result to the published edge for the same rules.
The shipped basic strategy for 6 decks, S17, DAS is implemented as a data table (BlackjackBasicStrategy), which serves three purposes at once:
- it drives the RTP test;
- it powers the optional in-game hint overlay;
- it is the thing a buyer edits if they change the rules.
The test simulates several million hands and asserts the measured return is consistent with 99.60 % within the run's own standard error — see the Testing section in this guide §4.
Measured result
| Hands simulated | 4,000,000 |
| Measured RTP | 99.5579 % (house edge 0.4421 %) |
| Standard error | 0.0491 percentage points |
| 95 % interval | 99.4616 % – 99.6541 % |
| Hit frequency | 43.31 % of hands return more than the stake |
| Max return | 2.50 × stake (a natural) |
| Outcome spread | 47.65 % lose everything · 8.86 % push · 38.79 % win up to 2× · 4.52 % win more |
The published 0.40 % sits comfortably inside the interval — the gap of 0.04 pp is under one standard error, so the implementation and the reference agree. A second test plays the same shoe with a deliberately bad strategy (stand on everything) and asserts it fails the 99.60 % target, so the edge test cannot pass vacuously.
Basic strategy (6 decks, S17, DAS)
Hard totals — 5–8 hit; 9 doubles against 3–6; 10 doubles against 2–9; 11 doubles against 2–10; 12 stands against 4–6; 13–16 stand against 2–6; 17+ always stands.
Soft totals — A2/A3 double against 5–6; A4/A5 double against 4–6; A6 doubles against 3–6; A7 doubles against 3–6, stands against 2, 7 and 8, hits against 9, 10 and A; A8/A9 stand.
Pairs — always split A,A and 8,8; never split 5,5 (play as hard 10) or 10,10; 2,2/3,3/7,7 split against 2–7; 4,4 splits against 5–6; 6,6 splits against 2–6; 9,9 splits against 2–6 and 8–9 and stands otherwise.
6. Sources consulted
- The Wizard of Odds' blackjack house-edge tables and rule-variation effects — the source of
- Standard published basic strategy charts for 6-deck S17 with DAS, which agree cell for cell
the 0.40 % figure for 6 decks / S17 / DAS / no surrender / peek, and of the per-rule deltas quoted in §1 (6:5 ≈ +1.39 %, H17 ≈ +0.22 %, no DAS ≈ +0.14 %).
with the table implemented in BlackjackBasicStrategy and reproduced in §5.
The two agree on both the rule set and the strategy. Where sources differ on marginal cells — 11 against an Ace is the usual one, doubled under H17 and hit under S17 — the S17 form is used because that is the shipped rule.
7. Deliberate deviations
- No surrender. It is a real rule worth about 0.08 %, but it adds a decision path and a UI
- No resplit of aces. Matches the majority of six-deck games and keeps the split logic simple.
- Single player seat. The kit's blackjack is one player against the dealer. Multi-seat is a
affordance for a small gain. The configuration flag exists and is off; wiring it is a Phase 4 task.
presentation change rather than a rules change and is left to the buyer.
8. Worked examples (become the first unit tests)
- Natural. Player A♠ K♦, dealer 9♥ 7♣. Player is paid 3:2 — a 100 wager returns 250.
- Push on naturals. Both have blackjack: the wager is returned, 100 returns 100.
- Dealer peek. Dealer shows an Ace with a ten in the hole. The round ends at once; the main
- Split. Player 8♠ 8♦ against a dealer 6. Splitting stakes a second 100. Each hand plays on.
- Double. Player 5♠ 6♦ (11) against a dealer 5. Doubling takes the wager to 200 and draws
- Dealer stands on soft 17. Dealer A♠ 6♦ is 17 and must stand, not draw.
wager loses and insurance pays 2:1, so a 100 wager with 50 insurance returns 150 — exactly the stake, which is the entire point of insurance being an even-money hedge against a natural.
exactly one card.
9. Definition of done
Tracked against the 16-point checklist in the Adding a Game section in this guide.
Caribbean Stud PokerCards · card_caribbeanstud+
Family: Cards · Complexity: M · Phase 4 · Reference house edge: 5.224 % of the ante
Written before any code, per the Adding a Game section in this guide step 1.
1. The shipped rule set
| Rule | Shipped value |
|---|---|
| Decks | 1, reshuffled every hand |
| Deal | Five cards each; one dealer card face up |
| Player choice | Fold, or Raise at twice the ante |
| Dealer qualifies | Ace-King high or better |
| Dealer does not qualify | Ante pays 1:1, Raise pushes |
| Dealer qualifies, player wins | Ante pays 1:1, Raise pays by the paytable |
| Dealer qualifies, tie | Both push |
| Dealer qualifies, player loses | Both lost |
| Optional side bet | 5+1 Bonus, player five cards plus dealer upcard |
| Bonus decision | Settles independently, including after a Fold |
House edge: 5.224 % of the ante. Expressed against everything actually wagered — the ante plus the raise the player makes about half the time — it is 2.56 %, and both figures are quoted in the help screen because only quoting the first makes the game look worse than it plays.
2. The Raise paytable
The Raise, and only the Raise, is paid by hand strength. The Ante always pays 1:1.
| Hand | Raise pays |
|---|---|
| Royal flush | 100:1 |
| Straight flush | 50:1 |
| Four of a kind | 20:1 |
| Full house | 7:1 |
| Flush | 5:1 |
| Straight | 4:1 |
| Three of a kind | 3:1 |
| Two pair | 2:1 |
| One pair or less | 1:1 |
A hand you cannot be paid for still has to beat the dealer. A royal flush pays 100:1 on the raise only if the dealer qualifies and loses — which is certain — but if the dealer fails to qualify the raise merely pushes and that royal collects the ante's 1:1 and nothing more. That is the single most complained-about rule in the game and it is faithfully implemented.
3. Optional 5+1 Bonus
The optional wager uses the player's five cards plus the dealer's exposed upcard and scores the best five-card poker hand among those six. It is already locked when the cards are dealt, so it settles independently of the Raise/Fold choice and dealer qualification.
| Best 5+1 hand | Bonus pays |
|---|---|
| Royal flush | 1000:1 |
| Straight flush | 200:1 |
| Four of a kind | 100:1 |
| Full house | 20:1 |
| Flush | 15:1 |
| Straight | 10:1 |
| Three of a kind | 7:1 |
| Two pair or less | 0 |
This is the current 5+1 schedule published by PokerStars' Evolution live-game rules, which quote 91.44 % RTP for the side bet. The game always discloses it separately from the main wager.
4. Dealer qualification is Ace-King, not a pair
The dealer needs ace-king high or better. A hand of A-K-7-4-2 qualifies; A-Q-J-10-9 does not. This is unusual — most carnival games qualify on a pair or a made hand — and getting it wrong in either direction moves the house edge by more than a point.
The dealer fails to qualify about 44 % of the time, which is why the game feels like it pays so often and returns so little: most of those hands win only the ante.
5. Strategy: raise on A-K-J-8-3 or better
Optimal play here depends on the dealer's upcard in a way no player memorises. The near-optimal rule that everyone actually uses is:
- Raise on any pair or better.
- Raise on ace-king high when the hand is at least A-K-J-8-3.
- Fold everything else.
That costs about 0.001 percentage points against true optimal play — small enough that the kit ships it as the strategy and says so, rather than implying it is optimal.
Folding everything would cost the whole ante every hand; raising everything costs far more than the strategy saves.
6. Sources consulted
- The Wizard of Odds' Caribbean Stud analysis — the 5.224 % house edge on the ante, the 2.56 %
- Published casino Caribbean Stud rule sheets — the one-card-up deal, the raise at exactly
- PokerStars / Evolution Caribbean Stud rules — the current 5+1 Bonus construction, its
element of risk, the Ace-King qualification rule, the raise paytable in §2, and the A-K-J-8-3 strategy boundary. Confirms every figure this game is verified against.
twice the ante, the push on the raise when the dealer fails to qualify, and the rule that a premium hand collects nothing extra against a non-qualifying dealer.
7-10-15-20-100-200-1000 paytable and its published 91.44 % RTP.
7. Why the return is measured rather than enumerated
Every deal is a player hand and a dealer hand: C(52,5) × C(47,5) = 3.99 × 10¹² combinations. Three card poker was enumerable at 407 million; this is ten thousand times larger and is not. The edge is therefore simulated over several million hands and reported with its standard error, in line with the Testing section in this guide.
What is checked exactly is the piece that can be: the dealer's qualification rate, and the frequency of each five-card hand, both of which fall out of the shared evaluator that is already proved against all 2,598,960 hands.
8. Deliberate deviations
- No progressive side bet. It has its own paytable, its own (usually dreadful) edge, and a
meter that has to persist across sessions. Deferred rather than half-built.
9. Achieved figures
The dealer's qualification rate over 200,000 hands, which depends on nothing but the qualification rule and is therefore the strongest evidence that rule is right:
| Figure | Measured | Expected |
|---|---|---|
| Dealer qualifies | 56.22 % | 56.12 % |
| Dealer fails to qualify | 43.78 % | 43.88 % |
This matters more than the house edge does. Several different mistakes could combine to produce a plausible-looking edge; only a correct Ace-King rule produces this number.
The edge over 3,000,000 hands played by the shipped strategy:
| Figure | Measured | Published |
|---|---|---|
| House edge, as a fraction of the ante | 5.352 % | 5.224 % (optimal play) |
| Element of risk, of everything wagered | 2.613 % | 2.56 % (optimal play) |
| Hands raised | 52.43 % | — |
The 0.13 percentage-point gap is the A-K-J-8-3 rule, not an error: published sources put the cost of that simplification at about 0.16 points, and 5.224 + 0.13 lands inside that. Shipping the simple rule and stating its cost is more useful than shipping an unmemorable optimal one.
Raising just over half the time is the other check on the strategy — a rule that raised 80 % or 20 % of hands would be wrong however good the edge looked.
Folding every hand loses exactly 100 % of the ante, and the strategy recovers all but 5.35 points of that. The fold decision is asserted to be worth something rather than assumed to be.
Exact ties are rare: three in 150,000 hands. Two five-card hands tie only when their ranks match position for position, which is why the tie push has its own test — the ordinary settlement sweep over 6,000 hands never reaches one, and a branch that is never exercised is a branch that is never checked.
10. Worked examples (become the first unit tests)
- A-K-7-4-2 qualifies; A-Q-J-10-9 does not. The rule the whole game turns on.
- Dealer does not qualify with a 100 ante and 200 raise → ante pays 1:1, raise pushes, so the
- A royal flush against a non-qualifying dealer still returns only 400. The rule players hate.
- Dealer qualifies, player wins with two pair → ante 100 → 200, raise 200 → 600, total 800.
- Dealer qualifies and wins → 0.
- A tie pushes both, returning 300.
- A-K-Q-J plus a dealer ten of the same suit makes the 5+1 royal and pays 1000:1, even if
return is 400.
the player folds the main hand.
11. Definition of done
Tracked against the 16-point checklist in the Adding a Game section in this guide.
Casino WarCards · card_war+
Family: Cards · Complexity: S · Phase 4 · Reference house edge: 2.88 % (always going to war)
Written before any code, per the Adding a Game section in this guide step 1.
1. The shipped rule set
| Rule | Shipped value |
|---|---|
| Decks | 6 |
| Ranking | Ace high, suits irrelevant |
| High card wins | 1:1 |
| On a tie | Surrender for half the wager, or go to war |
| Going to war | Double the wager, burn 3 cards, one more card each |
| Winning the war | The raise pays 1:1, the original wager pushes |
| Tying the war | Original pays 1:1 as a bonus |
| Tie side bet | 10:1 |
House edge for exactly this set: 2.88 % (RTP 97.12 %) when the player always goes to war. Surrendering on every tie is worse — about 3.70 % — which is the game's one strategy decision and the one thing the help screen must get across.
2. Why winning the war only pays on the raise
This is the rule that carries the entire house edge, and it is the one most often implemented wrongly. After a tie the player has doubled their exposure, but a win returns only the raise plus both stakes back — the original wager pushes rather than paying. The player risks two units to win one.
Without that asymmetry the game would return more than 100 %.
3. The tie side bet
Pays 10:1 when the first two cards tie. With six decks the chance of a tie is
P(tie) = 23 / 311 ≈ 0.07396
— after the first card, 23 of the remaining 311 cards share its rank. At 10:1 that returns 0.07396 × 11 = 0.8136, a house edge of 18.65 %. That is enormous and entirely normal for a side bet; the help screen states it rather than hiding it.
4. Sources consulted
- The Wizard of Odds' Casino War analysis — the 2.88 % figure for six decks with the player
- Published casino Casino War rule sheets — one card each, ace high, tie offers surrender or
always going to war, the 3.70 % figure for always surrendering, and the tie bet's 18.65 % edge at 10:1. Confirms all three numbers this game is verified against.
war, war burns three cards, and a war win pays the raise while the original pushes. Confirms the procedure and the payout asymmetry in §2.
5. Deliberate deviations
- No "tie on the war pays 2:1" variant. Some tables pay double on a war tie; here it is 1:1,
- A fixed burn of three cards. It has no effect on the odds with a six-deck shoe and exists
configurable.
for the ceremony, which is exactly why it is in the presentation layer's event stream.
6. Achieved figures
| Strategy | Return on all money risked | Element of risk | Published edge on initial wager |
|---|---|---|---|
| Always go to war | 97.34 % | 2.66 % | 2.88 % |
| Always surrender | 96.23 % | 3.77 % | 3.70 % |
Two million rounds each. Going to war is confirmed as the better play, which is the one thing the help screen has to convey.
The 0.22 pp difference is a denominator, not a rules mismatch. The published 2.88% is the expected loss divided by the original wager. The simulator's 2.66% is the element of risk: the same loss divided by every credit actually risked, including the extra wager on a war. Both are retained and named explicitly so Help and editor tooling do not call two different quantities “house edge.”
7. Worked examples (become the first unit tests)
- Player King, dealer Seven, 100 wager → returns 200 (stake plus 1:1).
- Player Seven, dealer King, 100 wager → returns 0.
- Tie, then surrender, 100 wager → returns 50.
- Tie, then war, player wins, 100 wager → 100 raise; returns 300 (both stakes back plus the
- Tie, then war, tie again, 100 wager → returns 300 (both player stakes back plus one
- Tie, then war, player loses → returns 0; both units are lost.
raise paid 1:1).
original-unit win, the same net result as a won war under the shipped rule).
8. Definition of done
Tracked against the 16-point checklist in the Adding a Game section in this guide.
Dragon TigerCards · card_dragontiger+
Family: Cards · Complexity: S · Phase 4 · Reference house edge: 3.73 % (Dragon/Tiger, 8 decks)
Written before any code, per the Adding a Game section in this guide step 1.
1. The shipped rule set
| Rule | Shipped value |
|---|---|
| Decks | 8 |
| Ranking | Ace low, King high; suits irrelevant to the result |
| Dragon / Tiger | 1:1 |
| On a tie | Dragon and Tiger wagers lose half |
| Tie bet | 8:1 |
| Suited Tie bet | 50:1 |
| Dragon-card side bets | Big, Small, Red, Black at 1:1; seven loses |
House edge: Dragon/Tiger 3.73 %, Tie 32.77 % at 8:1.
2. The tie rule is the whole house edge
Dragon and Tiger are symmetric — neither side has any advantage, and without the tie rule the bet would be exactly even money and the house would earn nothing. Taking half the wager on a tie is what creates the 3.73 %.
The arithmetic: with 8 decks, after the first card 31 of the remaining 415 cards share its rank, so
P(tie) = 31 / 415 ≈ 0.074699
and the edge on Dragon is half of that: 0.074699 / 2 ≈ 3.735 %. That relationship — edge is exactly half the tie probability — is a clean check on the implementation and is asserted in the tests.
3. The ace is low
Opposite to Casino War, where it is high. Both games are one-card comparisons in this kit and both use HandTotals, so the two are easy to confuse; each has a test pinning its own convention.
4. Sources consulted
- Singapore Gambling Regulatory Authority, Resorts World Sentosa Dragon Tiger rules — one
- Singapore Gambling Regulatory Authority, Marina Bay Sands Dragon Tiger rules — independent
- Pragmatic Play Dragon Tiger game rules — current commercial presentation reference for the
- PokerStars Dragon Tiger guide and Evolution Dragon Tiger — cross-checks for the
card to each hand, ace low through king high, comparison procedure and wager settlement. <https://www.gra.gov.sg/docs/default-source/game-rules/rws/baccarat-games/rws-game-rules---dragon-tiger.pdf>
regulator-hosted confirmation of the live-table procedure and wager families. <https://www.gra.gov.sg/docs/default-source/game-rules/mbs/other-games/dragon_tiger_%28mbs%29.pdf>
betting board, sequential reveal, side bets and recent-results display. <https://cdn-sp.kertn.net/assets/cms/App_Data/FM/603/GameRules/Pragmatic/GamerulesEN/DragonTiger.pdf>
one-card comparison, ace-low ranking and modern live-table interaction grammar. <https://www.pokerstars.com/casino/how-to-play/live/dragon-tiger/> <https://games.evolution.com/live-casino/dragon-tiger/>
5. Deliberate deviations
- Dragon-only Big/Small/Red/Black. Commercial variants differ in which hand(s) receive side
- Tie pays 8:1, not 11:1. Both exist commercially; 8:1 is the more common and is configurable.
bets. The shipped compact layout offers the configured four spots on the Dragon card, all fully resolved and tested, instead of claiming unimplemented Tiger or Odd/Even spots.
6. Authored table interaction
- Choosing a chip value never charges the wallet. Every tap adds exactly that denomination to any
UNDOremoves only the latest chip,CLEARremoves the staged layout, andDEALcommits the- Both cards travel face-down from a visible shoe. Dragon and Tiger are revealed in order through
- The settled view states exact return and signed net, highlights the winning hand, and records the
of the eight spots; multiple colors remain full-sized in the physical stack.
complete multi-spot slip in one atomic debit.
explicit squeeze controls; the comparison is withheld until the second reveal.
outcome in a twelve-result bead road. A new deal collects the old cards before it charges again.
7. Achieved figures
| Dragon / Tiger RTP | 96.34 % ± 0.069 pp (house edge 3.66 %) |
| Predicted from P(tie)/2 | 3.7349 % |
| Published | 3.73 % |
| Hit frequency | 46.30 % |
| Rounds simulated | 2,000,000 |
Dragon measured 96.26 % and Tiger 96.34 % — statistically indistinguishable, as they must be for a symmetric game. That symmetry check is a test in its own right: if the two sides ever diverge, something in the deal or the resolution is biased.
The closed-form prediction (edge = half the tie probability) lands within the measurement's error bars, which is a stronger result than matching a published number alone — it means the implementation agrees with the derivation, not just with a table.
8. Worked examples (become the first unit tests)
- Dragon King, Tiger Seven, 100 on Dragon → returns 200.
- Dragon Ace, Tiger Two → Tiger wins; the ace is low.
- Tie, 100 on Dragon → returns 50.
- Tie, 100 on the Tie bet at 8:1 → returns 900.
- Tie in the same suit, 100 on Suited Tie at 50:1 → returns 5,100.
9. Definition of done
Tracked against the 16-point checklist in the Adding a Game section in this guide.
Side bets on the Dragon card (added v1.1)
Four even-money spots read the Dragon card alone; a seven loses all of them. This is the standard live-casino side-bet family for the game.
Sources:
- Wizard of Odds, "Dragon Tiger" — Big/Small defined as above/below seven, seven loses,
- Evolution Gaming live Dragon Tiger help — Big/Small and Suit (Red/Black) side bets, all
house edge 7.69 %.
pay 1:1, seven loses.
| Bet | Wins on | P(win) | Pays | Return |
|---|---|---|---|---|
| Big | 8, 9, 10, J, Q, K (ace low) | 24/52 = 6/13 | 1:1 | 12/13 = 92.31 % |
| Small | A, 2, 3, 4, 5, 6 | 6/13 | 1:1 | 12/13 |
| Red | hearts or diamonds, not a 7 | 6/13 | 1:1 | 12/13 |
| Black | spades or clubs, not a 7 | 6/13 | 1:1 | 12/13 |
The house edge is exactly 1/13 ≈ 7.692 % on each spot, independent of deck count (suit and rank proportions are constant across decks). Verified by exact enumeration of the 52-card space in DragonTigerSideBetTests, plus a simulated cross-check through the shoe.
Ultimate Texas Hold'emCards · card_holdem+
Family: Cards · Complexity: L · Phase 4 · Reference house edge: 2.185 % of the ante
Written before any code, per the Adding a Game section in this guide step 1.
1. Why this is the house-banked form
This is a casino kit, so card_holdem is Ultimate Texas Hold'em — one player against the dealer, house-banked — not ring-game poker. Player-versus-player hold'em needs a lobby, seats, betting rounds, a pot, side pots and opponents; none of that belongs in a single-player casino title and half-building it would be worse than not shipping it.
2. The shipped rule set
| Rule | Shipped value |
|---|---|
| Decks | 1, reshuffled every hand |
| Opening wager | Ante and Blind, equal. Optional Trips side bet |
| Deal | Two cards to the player, two to the dealer, five community cards |
| Pre-flop | Check, or bet 4× the ante |
| After the flop | If checked: check again, or bet 2× |
| After the river | If checked twice: bet 1×, or fold |
| Dealer qualifies | A pair or better |
The Play bet only shrinks. Betting early is how the player gets value, and the whole game is about recognising the hands worth 4× before seeing a single community card.
3. Settlement — three bets, three different rules
This is where implementations go wrong, because each of the three wagers settles differently.
Ante
- Dealer does not qualify → pushes (regardless of who would have won)
- Dealer qualifies and player wins → 1:1
- Tie → push · Player loses → lost
Play
- Player wins → 1:1 · Tie → push · Player loses → lost
- Dealer qualification is irrelevant to the Play bet
Blind
- Player wins with a straight or better → pays the paytable below
- Player wins with less than a straight → pushes
- Tie → push · Player loses → lost
Folding loses the Ante and the Blind together. The Trips side bet still resolves.
| Blind pays | |
|---|---|
| Royal flush | 500:1 |
| Straight flush | 50:1 |
| Four of a kind | 10:1 |
| Full house | 3:1 |
| Flush | 3:2 |
| Straight | 1:1 |
| Less than a straight | push |
The Blind is the reason a big hand matters even in a game where the Play bet is capped: it is the only wager that pays more than even money.
4. Strategy
Optimal play here is famously intricate. Since v1.1 the river decision is exact; the pre-flop and flop lists remain documented simplifications:
Pre-flop, bet 4× with:
- Any pocket pair of threes or better
- Any ace
- King with a five or better offsuit, or any king suited
- Queen with an eight or better offsuit, or a six or better suited
- Jack-ten offsuit, or jack-eight or better suited
After the flop, bet 2× with:
- Two pair or better
- A hidden pair — one that uses at least one hole card
- Four to a flush including a hole card of ten or better
After the river, decide exactly (v1.1): HoldemRiverOracle enumerates all C(45,2) = 990 dealer hole pairs, settles every one through the real matrix — pair-or-better qualification on the ante, the play bet indifferent to it, the blind paytable on straight-or-better wins — and bets 1× when the expected value of betting is at least the two units folding forfeits. This is the lookup the strategy literature compresses into "bet if you beat enough of the 990"; enumerated, it needs no threshold constant at all. One consequence worth naming: a royal (or any unbeatable hand) sitting wholly ON the board is a bet, not a fold — all 990 lines push, and folding surrenders the ante and blind for nothing. The affordable part is a histogram seven-card scorer proven bit-identical to the subset evaluator on a 60,000- hand random sweep plus constructed traps.
The measured cost of the remaining simplifications against the published optimum is reported in §8 rather than assumed away.
5. Sources consulted
- The Wizard of Odds' Ultimate Texas Hold'em analysis — the 2.185 % house edge on the ante,
- Published casino Ultimate Texas Hold'em rule sheets — the ante push when the dealer fails
the 0.53 % element of risk, the Blind paytable in §3, the pair-or-better dealer qualification, and the three-tier 4×/2×/1× betting structure. Confirms every figure this game is verified against.
to qualify, the Blind pushing on a win below a straight, and folding forfeiting both the Ante and the Blind.
6. Why the return is measured rather than enumerated
C(52,2) player hands × C(50,2) dealer hands × C(48,5) boards is about 2.7 × 10¹² deals, and each needs three decisions evaluated. Not enumerable. The edge is simulated over several million hands and reported with its standard error.
What is checked exactly is the settlement: every branch of the three-bet matrix in §3 is asserted against hands constructed to reach it.
7. Deliberate deviations
- The Trips side bet ships but is not part of the headline edge. It resolves on the player's
- No progressive. Same reasoning as the other games in this family.
- 3× pre-flop variant not shipped. Some casinos offer 3× instead of 4×; it is a one-line
own five cards regardless of the outcome, so it is measured separately.
configuration change and is exposed, but the reference figures assume 4×.
8. Achieved figures
Over 1,000,000 hands played by the shipped strategy with the v1.1 exact river:
| Figure | Measured | Published (optimal play) |
|---|---|---|
| House edge, of the ante | 3.276 % | 2.185 % |
| Element of risk | 0.788 % | 0.53 % |
| Decision | Measured | Published |
|---|---|---|
| Bet 4× pre-flop | 37.73 % | 38.1 % |
| Bet 2× after the flop | 21.70 % | 19.6 % |
| Bet 1× after the river | 21.50 % | 21.4 % |
| Fold | 19.07 % | 20.9 % |
The river now bets at the published optimal frequency because the river IS optimal. The residual 1.1 points of edge over the full optimum live entirely in the pre-flop and flop lists — visible in the flop row betting 2× at 21.7 % against a published 19.6 %, which also steals about 1.8 points of hands from the river decision's bucket. Those lists remain documented simplifications; the decision that dominated the edge is a lookup now, not a rule.
Tuning the river rule, and what each attempt cost
The river decision turned out to dominate everything else. Four versions, measured:
| River rule | Fold rate | House edge |
|---|---|---|
| Bet whenever the hole cards improve on the board | 4.31 % | 10.63 % |
| Bet only with a hidden pair or better | 27.78 % | 7.71 % |
| Hidden pair or better, or a jack-or-better kicker that plays | 19.53 % | 5.35 % |
| Exact: EV over all 990 dealer hands ≥ the −2 units of folding (v1.1) | 19.07 % | 3.276 % |
The first reads as reasonable and is far too loose — a better kicker counts as an improvement. The second over-corrects: folding costs the ante and the blind outright, two units, while betting and losing costs three, so the last unit is right whenever the hand wins about one time in five. The third was v1.0's shipped rule. The fourth is not a rule at all: with the board fixed the dealer's holding is one of exactly 990 pairs, so the decision is settled by enumeration — two further points of edge recovered by refusing to approximate what can be computed. It also fixed a quiet money-loser: the rules of thumb folded hands that played the board unimprovably (a board royal!), surrendering two units on lines where betting pushes everything.
The settlement matrix is asserted, not inferred
Every branch of §3 is checked against hands constructed to reach it, over 6,000 rounds, with the test failing if any branch was never exercised: the ante pushing on a non-qualifying dealer even on a win, the play bet ignoring qualification, the blind pushing on wins below a straight and paying above it, and folding forfeiting both the ante and the blind.
The flush row is the kit's only fractional payout and is stored in halves so the paytable stays integral: 3:2 is "three halves", and a 25-unit blind returns 37 rather than 37.5 — rounded down, in the house's favour, like every other payout in the kit.
A trap worth recording
HoldemSettings.ReferenceDefaults was first written as new HoldemSettings(). On a struct whose constructor takes only optional parameters, that invokes the implicit zeroing constructor and every default is silently lost. The IsConfigured guard caught it on the first run — the same guard, for the same reason, that BlackjackSettings carries.
9. Worked examples (become the first unit tests)
- Dealer does not qualify → the ante pushes, even when the player wins the hand.
- The Play bet ignores qualification: it pays 1:1 on a win whether the dealer qualified or not.
- A win with two pair pushes the Blind; a win with a straight pays it 1:1.
- A flush pays the Blind 3:2 — the one fractional row, and it rounds in the house's favour.
- Folding loses both the Ante and the Blind.
- Betting 4× pre-flop stakes four units, and the Play bet cannot be raised later.
10. Definition of done
Tracked against the 16-point checklist in the Adding a Game section in this guide.
Let It RideCards · card_letitride+
Family: Cards · Complexity: M · Phase 4 · Reference house edge: 3.51 % of the base unit
Written before any code, per the Adding a Game section in this guide step 1.
1. The shipped rule set
| Rule | Shipped value |
|---|---|
| Decks | 1, reshuffled every hand |
| Opening wager | Three equal bets — the player stakes 3 units, not 1 |
| Deal | Three cards to the player, two community cards face down |
| First decision | Seeing three cards: withdraw bet 1, or let it ride |
| Second decision | After the first community card: withdraw bet 2, or let it ride |
| Bet 3 | Always rides. It can never be withdrawn |
| Final hand | The player's three cards plus both community cards |
| Minimum paying hand | Pair of tens or better |
The player never plays against a dealer. There is no opponent hand and nothing to beat — the final five cards either reach the paytable or they do not.
2. The paytable
Paid on each bet still on the table, independently.
| Hand | Pays |
|---|---|
| Royal flush | 1000:1 |
| Straight flush | 200:1 |
| Four of a kind | 50:1 |
| Full house | 11:1 |
| Flush | 8:1 |
| Straight | 5:1 |
| Three of a kind | 3:1 |
| Two pair | 2:1 |
| Pair of tens or better | 1:1 |
| Anything less | lose |
Tens or better, not jacks. Video poker pays from jacks; this game pays from tens, and the two are confused constantly. One rank changes the house edge by more than a point.
3. Withdrawing is not folding
A withdrawn bet is returned in full — it neither wins nor loses. That makes the two decisions free options rather than concessions, and it is why the game is beatable-looking and is not: the one bet the player can never pull back is the one that does the work.
The player stakes 3 units and, playing correctly, averages about 1.23 units actually at risk. Both figures matter, so both are reported:
- House edge — the loss as a fraction of the base unit: 3.51 %.
- Element of risk — the loss as a fraction of what was actually wagered: 2.85 %.
Quoting only the first overstates the game; quoting only the second understates it.
4. Strategy
First decision, on three cards — let it ride with:
- A paying hand: three of a kind, or a pair of tens or better.
- Three to a royal flush.
- Three suited cards in sequence — except A-2-3 and 2-3-4, which cannot make the high straights
- Three to a straight flush, spread 4, with at least one high card (ten or above).
- Three to a straight flush, spread 5, with two high cards.
that justify the others.
Second decision, on four cards — let it ride with:
- A paying hand.
- Four to a flush.
- Four to an outside straight.
- Four to an inside straight with four high cards.
Everything else is withdrawn. Note what is absent from the first list: a low pair is not worth riding on, even though it is one card from trips.
5. This game is enumerable, and is enumerated
Unlike Caribbean Stud, the whole game fits: C(52,3) player hands × 49 × 48 ordered community pairs = 51,979,200 deals. The community cards are taken as an ordered pair because the first one is revealed before the second decision, so the order genuinely matters.
That means the house edge here is exact, with no sampling and no error bar — which is unusual for this game, since most published figures for it are simulated.
The two decisions are hoisted out of the inner loops: the first depends only on the three player cards (22,100 evaluations), the second only on those plus the first community card (1,082,900). Only the final five-card evaluation runs all 51,979,200 times.
6. Sources consulted
- The Wizard of Odds' Let It Ride analysis — the 3.51 % house edge, the 2.85 % element of
- Published casino Let It Ride rule sheets — the three equal bets, the two withdrawal points,
risk, the paytable in §2, and the two strategy lists in §4 including the A-2-3 and 2-3-4 exceptions. Confirms every figure this game is verified against.
the rule that bet 3 always rides, and that a withdrawn bet is returned rather than forfeited.
7. Deliberate deviations
- No $1 bonus side bet. It carries a house edge in the region of 25 % depending on the pay
- No three-card bonus. Same reasoning.
table, needs its own paytable, and is a poor thing to ship carelessly.
8. Achieved figures — exact, not simulated
All 51,979,200 deals enumerated in about twenty seconds. No sampling, no error bar.
| Figure | Exact | Published |
|---|---|---|
| House edge, of the base unit | 3.5057 % | 3.51 % |
| Element of risk, of what is wagered | 2.8475 % | 2.85 % |
| Average units at risk (of 3 staked) | 1.2312 | — |
| Bet 1 ridden | 7.28 % of deals | — |
| Bet 2 ridden | 15.84 % of deals | — |
| Deals reaching the paytable | 23.878 % | — |
Both published figures are matched to three decimal places. The average-units-at-risk figure is what reconciles them: 3.5057 / 2.8475 = 1.231, exactly the measured exposure. That the two edges and their ratio all agree independently is stronger evidence than any one of them.
Where the return comes from
| Hand | Frequency | Contribution |
|---|---|---|
| Pair of tens or better | 16.2527 % | 31.241 % |
| Two pair | 4.7539 % | 16.553 % |
| Three of a kind | 2.1128 % | 12.445 % |
| Straight | 0.3925 % | 2.823 % |
| Flush | 0.1965 % | 3.299 % |
| Full house | 0.1441 % | 3.876 % |
| Four of a kind | 0.0240 % | 3.158 % |
| Straight flush | 0.0014 % | 0.690 % |
| Royal flush | 0.000154 % | 0.462 % |
The bottom half of that table is why the game feels the way it does: half the return comes from pairs and two pair, and the 1000:1 royal contributes less than half a percent. The five-card frequencies also cross-check the shared evaluator, which is separately proved against all 2,598,960 hands — a fault anywhere in that chain would show up here.
Riding every bet would cost about 8.54 % of a unit against the strategy's 3.51 %. The two withdrawal decisions are worth roughly five points of edge, which is what makes them decisions rather than decoration.
The bet-1 ride rate of 7.28 % is worth noticing: the first decision is a withdrawal more than nine times in ten. A three-card hand almost never justifies leaving money out.
9. Worked examples (become the first unit tests)
- A pair of tens pays; a pair of nines does not. The rule this game is built on.
- A withdrawn bet is returned. Withdrawing both optional bets and losing returns 2 of the 3 units.
- Bet 3 cannot be withdrawn — the rules core must refuse.
- A royal flush with all three bets riding pays 3,000 units, not 1,000.
- Three suited in sequence rides; A-2-3 suited does not.
- A low pair is withdrawn on the first decision.
10. Definition of done
Tracked against the 16-point checklist in the Adding a Game section in this guide.
Pai Gow PokerCards · card_paigow+
Family: Cards · Complexity: L · Phase 4 · Reference house edge: 2.84 % (5 % commission, house way)
Written before any code, per the Adding a Game section in this guide step 1.
1. The shipped rule set
| Rule | Shipped value |
|---|---|
| Deck | 53 cards — a standard deck plus one joker |
| Deal | Seven cards each to player and dealer |
| Setting | Split into a five-card high hand and a two-card low hand |
| Legality | The high hand must outrank the low hand. Setting them backwards is a foul |
| Win | Player must win both hands. Pays 1:1 less 5 % commission |
| Lose | Dealer wins both |
| Push | One each — and this happens about 41 % of the time |
| Copies | An exact tie on either hand goes to the dealer |
The push rate is the defining statistic. Nearly half of all hands end with nothing changing hands, which is why pai gow plays slowly and why its house edge is small compared with how often the player fails to win.
2. The joker is semi-wild, not wild
The joker may be used as:
- an ace, or
- any card that completes a straight, a flush, or a straight flush.
It may not pair with anything else. A joker alongside two kings is not three kings — it is a pair of kings with an ace. Treating it as fully wild is the most common implementation error in this game and it inflates the player's return substantially.
3. Two ranking quirks that exist nowhere else
A-2-3-4-5 is the second-highest straight. In every other poker game in this kit the wheel is the lowest straight, five-high. In pai gow it ranks above K-Q-J-10-9 and below A-K-Q-J-10. This is not folklore; it is the standard rule, and it is the single most-missed detail in pai gow implementations.
Five aces beats a royal flush. Four natural aces plus the joker is the highest hand in the game, above everything else.
4. The two-card low hand
Only two hands exist: a pair, or two high cards. A pair of aces is the best possible low hand; 3-2 offsuit is the worst. Flushes and straights do not exist over two cards and are not recognised — a common mistake and an easy one to make when reusing a five-card evaluator.
5. Setting the hands
The dealer sets by "house way", a fixed published procedure. The kit ships a documented simplification of it: among all 21 legal ways to split seven cards into 5 and 2,
maximise the low hand, and break ties by maximising the high hand.
This captures house way's actual principle — you must win both hands, so a high hand that is overwhelming while the low hand is rubbish loses half the time. It reproduces house way's most characteristic decisions: a full house is split, trips go high with the next two cards low, and two pair usually splits.
It is a simplification and is labelled as one. The measured cost against published house way is reported in §8 rather than assumed to be zero.
Both the player and the dealer use it, which is what the published 2.84 % figure assumes.
6. Why the return is measured rather than enumerated
C(53,7) = 154,143,080 player hands, and for each of those C(46,7) = 53,524,680 dealer hands. The product is about 8 × 10¹⁵ — not enumerable by any margin. The edge is simulated over several million hands and reported with its standard error.
What is exact here is the ranking: the joker rules, the wheel promotion and five aces are all asserted directly on constructed hands rather than inferred from the edge.
7. Deliberate deviations
- No Fortune or Emperor's Challenge side bets. Each needs its own paytable and pays on the
- No player-banking. Banking alternates who takes copies and changes the edge substantially;
- Commission is 5 % of the win, rounded down in the house's favour, matching
Money.MulRatio.
seven cards rather than the split, which is a different evaluation entirely.
it needs a seat-rotation model the kit does not have yet.
8. Achieved figures
Over 250,000 hands, both sides set by the house way in §5:
| Figure | Measured | Published |
|---|---|---|
| Player wins | 28.41 % | 28.61 % |
| Dealer wins | 29.56 % | 29.91 % |
| Push | 42.03 % | 41.48 % |
| House edge | 2.5698 % | 2.84 % |
The three outcome rates are the real result — each within 0.6 points of published — and the edge follows from them arithmetically: 0.2956 − 0.95 × 0.2841 = 0.02570, exactly the measured figure. The residual gap to 2.84 % is the setting approximation, and it is small enough to be worth the simplicity.
Why 250,000 and not a million. Pai gow is the most expensive hand in the kit to evaluate — two seven-card settings, each trying all 21 splits, each five-card hand trying up to 52 joker substitutions — and a million hands exceeded NUnit's 180-second default timeout. Cutting it costs nothing: at 250,000 the standard error on a ~0.42 push rate is 0.001, still forty times tighter than the ±0.04 the test asserts. The tolerance here is set by the house-way approximation, not by sampling noise, so more hands would only buy precision the model cannot use. The figures moved by less than a twentieth of a point.
The push rate is what caught a bad model
The first version of the setter simply maximised the low hand subject to legality. Its house edge came out at 2.9145 % — within a tenth of a point of published, and completely convincing if that had been the only figure checked.
Its push rate was 28.96 % against a real 41.5 %, and its win and lose rates were both around 35 %. Maximising the low hand strips the high hand back to the legal minimum, which makes the two hands rise and fall together — so hands tend to win both or lose both, and the splits that produce pushes stop happening.
That is why §1 calls the push rate the defining statistic and why it is asserted with a tighter tolerance than the edge. A house edge can be right for the wrong reasons; the outcome distribution cannot.
The replacement expresses house way as a constraint plus an objective — keep the high hand at the category house way demands, then push as much as possible into the low hand — rather than as a hundred special cases. It reproduces the characteristic calls (full houses split, trips go high with the next two low, two pair splits, three aces split) and restores the real distribution.
Ranking rules, asserted directly
None of these are inferred from the edge:
- Joker + K-K is a pair of kings with an ace, not three kings.
- The joker completes a flush from four suited cards, and a straight from an open-ended four.
- Five aces scores above a royal flush.
- A-2-3-4-5 beats K-Q-J-10-9 and loses to A-K-Q-J-10 — and the shared evaluator is separately
- Two suited cards are not a flush and 7-6 is not a straight.
- The setter never fouls, over 20,000 hands.
- A copy never counts as a player win on that hand.
asserted to still rank the wheel lowest for every other game in the kit.
9. Worked examples (become the first unit tests)
- Joker + K-K is a pair of kings with an ace, not three kings.
- Joker completes a flush when four cards share a suit.
- A-2-3-4-5 beats K-Q-J-10-9 and loses to A-K-Q-J-10.
- Five aces beats a royal flush.
- A copy pushes to the dealer — an identical low hand loses, it does not tie.
- The setter never fouls: over many thousands of hands the high hand always outranks the low.
- A win of 100 returns 195, being the stake plus 95 after the 5 % commission.
10. Definition of done
Tracked against the 16-point checklist in the Adding a Game section in this guide.
Fortune bonus side bet (added v1.1)
An optional wager on the player''s own seven cards, paid from three of a kind up regardless of how the hands are set or who wins the main bet. The envy bonus is omitted — this is a single-seat table, and envy pays on other players'' hands.
Sources:
- Wizard of Odds, "Pai Gow Poker — Fortune side bet": rules and the standard no-envy
- Bally / Scientific Games "Fortune Pai Gow Poker" rack card: bonus reads all seven cards,
paytable below.
plays regardless of the main-hand result.
| Hand | Pays |
|---|---|
| Natural seven-card straight flush | 8000:1 |
| Seven-card straight flush with the joker | 2000:1 |
| Five aces | 400:1 |
| Royal flush | 150:1 |
| Straight flush | 50:1 |
| Four of a kind | 25:1 |
| Full house | 5:1 |
| Flush | 4:1 |
| Three of a kind | 3:1 |
| Straight | 2:1 |
The joker is the game''s usual semi-wild joker throughout. Return measured by simulation over the 53-card deck (PaiGowFortuneTests, 2,000,000 deals) with the standard error reported in the test; the measured figure and its uncertainty are pinned there.
Three Card PokerCards · card_threecard+
Family: Cards · Complexity: M · Phase 4 · Reference house edge: 3.37 % of the ante (Ante/Play)
Written before any code, per the Adding a Game section in this guide step 1.
1. The shipped rule set
| Rule | Shipped value |
|---|---|
| Decks | 1, reshuffled every hand |
| Deal | Three cards to the player, three to the dealer |
| Player choice | Fold, or make a Play wager equal to the Ante |
| Dealer qualifies | Queen high or better |
| Dealer does not qualify | Ante pays 1:1, Play pushes |
| Dealer qualifies, player wins | Ante and Play both pay 1:1 |
| Dealer qualifies, tie | Both push |
| Ante Bonus | Paid regardless of the dealer: straight 1:1, trips 4:1, straight flush 5:1 |
| Pair Plus | pair 1:1, flush 4:1, straight 6:1, trips 30:1, straight flush 40:1 |
House edge: 3.37 % of the ante on Ante/Play with optimal strategy; 2.32 % on Pair Plus.
2. Three-card hand ranking — a straight beats a flush
| Rank | Hand | Frequency (of 22,100) |
|---|---|---|
| 1 | Straight flush | 48 |
| 2 | Three of a kind | 52 |
| 3 | Straight | 720 |
| 4 | Flush | 1,096 |
| 5 | Pair | 3,744 |
| 6 | High card | 16,440 |
A straight beats a flush here, the opposite of five-card poker. It is not a mistake carried over — with only three cards a straight is genuinely rarer (720 hands against 1,096), so the ranking inverts. This is the single most common bug in three card poker implementations.
The ranking is implemented by ThreeCardEvaluator in the rules kernel, which is verified by exhaustive enumeration of all 22,100 hands against the frequency table above. That verification already exists and is not repeated here.
3. Optimal strategy: play Q-6-4 or better
The player's only decision. The boundary is Queen, Six, Four — play any hand that ranks at or above it, fold everything below.
That specific hand is not arbitrary: it is the point at which the expected value of making the Play wager crosses the expected value of folding. Playing every hand costs about 0.3 % more; folding everything costs far more than that.
The strategy is exposed as ThreeCardStrategy.ShouldPlay, drives the RTP test, and powers the optional in-game hint.
4. Why the Ante Bonus is paid regardless of the dealer
A player who makes a straight or better is paid the Ante Bonus even if the dealer beats them and even if they lose the hand. It is a bonus on the player's own cards, not on the outcome, and implementations that gate it on winning quietly underpay.
5. Sources consulted
- The Wizard of Odds' three card poker analysis — the 3.37 % Ante/Play house edge with optimal
- Published casino three card poker rule sheets — Queen-high dealer qualification, the Play
play, the Q-6-4 strategy boundary, the 2.32 % Pair Plus edge on the 1-4-6-30-40 paytable, and the three-card hand frequencies in §2. Confirms every figure this game is verified against.
wager equal to the Ante, the Play push when the dealer fails to qualify, and the Ante Bonus being independent of the outcome. Confirms the procedure.
6. Deliberate deviations
- No 6-Card Bonus. The catalogue lists it; it evaluates the player's three cards plus the
- Single deck, reshuffled every hand. Standard for this game.
dealer's three as a five-card hand and needs its own paytable. Deferred rather than half-built.
7. Achieved figures — exact, not simulated
Three card poker is small enough to enumerate completely: 22,100 player hands × 18,424 dealer hands = 407,170,400 deals, which ThreeCardExactMath.Compute walks in about six seconds. There are no error bars on any figure below.
| Figure | Exact | Published |
|---|---|---|
| Ante/Play house edge, Q-6-4 strategy | 3.3730 % | 3.37 % |
| Ante/Play house edge, per-hand optimal | 3.3730 % | — |
| Ante/Play house edge, never folding | 7.6538 % | — |
| Pair Plus house edge | 2.3167 % | 2.32 % |
| Pair Plus return | 97.6833 % | — |
| Hands folded | 32.58 % | — |
The Q-6-4 boundary is derived here, not quoted
The expected value of playing is computed for each of the 22,100 hands and compared against −1, the value of folding. The weakest hand whose expected value beats folding comes out as exactly Q-6-4 (EV −0.99463), and sweeping the threshold confirms it is the best simple rule:
| Threshold | House edge |
|---|---|
| Q-6-3 (one rank looser) | 3.3738 % |
| Q-6-4 | 3.3730 % |
| Q-6-5 (one rank tighter) | 3.3746 % |
| K-3-2 | 4.9855 % |
| J-9-8 | 3.7568 % |
Per-hand optimal play and the Q-6-4 rule give the same edge to four decimal places, which is why Q-6-4 is the strategy that gets taught: a single memorable hand captures all of it. Playing every hand costs 4.28 percentage points.
ThreeCardExactMath duplicates the hand evaluator to skip a sort inside the 407-million-deal loop; FastScorerAgreesWithTheEvaluatorOnEveryHand checks the copy against the original on all 22,100 hands so the two cannot drift apart.
The settlement tests do not check a handful of contrived hands — they replay 4,000 real deals and assert the payout the rule sheet demands for whichever branch each deal took, then assert that all five branches (no-qualify, win, loss, tie, and a straight-or-better that lost but still collected the Ante Bonus) were actually reached.
8. Worked examples (become the first unit tests)
- A nine-high straight beats an ace-high flush. The defining quirk.
- Dealer holds Jack high → does not qualify. With a 100 ante and 100 play: ante pays 1:1 and
- Dealer qualifies and the player wins, 100 + 100 → 400.
- Dealer qualifies and the player loses → 0.
- Player folds → the ante is lost; Pair Plus, if placed, still resolves.
- Player has a straight and loses to the dealer → Ante Bonus still pays 1:1 on the ante.
play pushes, so the return is 300.
9. Definition of done
Tracked against the 16-point checklist in the Adding a Game section in this guide.
6-Card Bonus side bet (added v1.1)
An optional wager on the best five-card poker hand that can be made from all six dealt cards (player three plus dealer three). It resolves on the cards alone — fold or play — from three of a kind up.
Sources:
- Wizard of Odds, "Three Card Poker — 6 Card Bonus": rules and the family of published
- Bally / Scientific Games "Three Card Poker with 6 Card Bonus" rack card: best five of six,
paytables paying from trips up, royal at the top.
plays regardless of the fold decision.
Shipped paytable and exact figures (enumerated over all C(52,6) = 20,358,520 six-card subsets, ThreeCardSixCardBonusTests):
| Hand | Pays | Anchor counts |
|---|---|---|
| Royal flush | 1000:1 | exactly 188 subsets (4 royals × 47) |
| Straight flush | 200:1 | |
| Four of a kind | 50:1 | exactly 14,664 subsets (13 × C(48,2)) |
| Full house | 25:1 | |
| Flush | 20:1 | |
| Straight | 10:1 | |
| Three of a kind | 5:1 |
Return: 18,276,904 / 20,358,520 = 89.7752 % — house edge 10.2248 %, exact.
Video Poker — Jacks or BetterCards · card_videopoker+
Family: Cards · Complexity: L · Phase 4 · Reference return: 99.5439 % (9/6 Jacks or Better, optimal play)
Written before any code, per the Adding a Game section in this guide step 1.
1. The shipped rule set
| Rule | Shipped value |
|---|---|
| Decks | 1, reshuffled every hand |
| Deal | Five cards face up |
| Player choice | Hold any subset of the five, then draw replacements |
| Draw | From the same 47 remaining cards, never a fresh deck |
| Minimum paying hand | Pair of Jacks or better |
| Coins | 1–5. Only the royal flush pays disproportionately more at 5 coins |
2. The 9/6 paytable
Per coin bet, except the 5-coin royal.
| Hand | 1 coin | 5 coins |
|---|---|---|
| Royal flush | 250 | 4,000 |
| Straight flush | 50 | 250 |
| Four of a kind | 25 | 125 |
| Full house | 9 | 45 |
| Flush | 6 | 30 |
| Straight | 4 | 20 |
| Three of a kind | 3 | 15 |
| Two pair | 2 | 10 |
| Jacks or better | 1 | 5 |
"9/6" names the full-house and flush rows, and those two rows are the entire difference between a 99.54 % machine and a bad one. 8/5 returns 97.30 %; 7/5 returns 96.15 %. Nothing else in the table moves the return remotely as much, which is why the game is named after them.
The 5-coin royal is not a rounding artefact. At 1–4 coins the royal pays 250 per coin; at 5 it pays 800 per coin. That single jump is worth about 1.5 percentage points of return and is the reason correct play is always to bet maximum coins. The kit's bet ladder therefore steps in coins, not credits, and the help screen says why.
3. Why the draw comes from the same 47 cards
The discarded cards are not returned to the deck. A player holding four hearts is drawing from 47 cards of which 9 are hearts, not from 52 of which 13 are. Implementations that reshuffle before the draw quietly change every probability in the game. The shoe is dealt straight through.
4. Exact mathematics — what is and is not tractable
This is the one game in the kit where the honest answer is "partly".
Exactly computable, and computed:
- The expected value of any given hold, by enumerating every possible draw — C(47, 5−k)
- The optimal hold for a given hand, by taking the best of all 32 holds. That is 2,598,960 draw
combinations, at most 1,533,939. This is VideoPokerAnalysis.ExactHoldEv, and it is exact with no sampling whatsoever.
evaluations per hand — a fraction of a second. This is VideoPokerAnalysis.BestHold.
Not tractable here: the exact overall return under optimal play. It requires the optimal hold for each of the 2,598,960 possible deals, and each of those costs 2,598,960 draw evaluations — on the order of 6.75 × 10¹² hand evaluations. Published figures like 99.5439 % come from analyzers built for that one job, running for a long time with heavy precomputation. Reproducing that inside a Unity test suite would be dishonest about what the test is actually checking.
So the return is measured, not claimed: the shipped strategy table plays out several million hands and the result is reported with its standard error. Separately, that strategy table is checked against exhaustive optimal play on a sample of hands — which is the claim that actually matters, because a strategy table that agrees with the optimum is the only way the simulated return can be trusted at all.
5. Sources consulted
- IGT Video Poker and Game King product material — the recognizable single-hand cabinet,
- The Wizard of Odds' video poker analysis — the 99.5439 % optimal return for 9/6 Jacks or
- Published Jacks-or-Better strategy charts — the ordered hold priority implemented in
five direct card holds, prominent paytable, one-to-five coin selection and DEAL/DRAW interaction.
Better, the 97.30 % and 96.15 % figures for the 8/5 and 7/5 variants, and the full-pay paytable in §2. Confirms every figure this game is verified against.
VideoPokerStrategy, including the two rungs most often gotten wrong: a 4-card flush beats a low pair, and a low pair beats a 4-card open-ended straight.
6. Deliberate deviations
- Jacks or Better only. Deuces Wild, Bonus Poker, Double Double Bonus and Joker Poker each
- No progressive royal. It changes optimal strategy as the jackpot grows, which is a genuinely
- No double-up gamble. It is an optional post-win side game rather than part of Jacks or Better's
need their own paytable and their own strategy — the strategies are not adaptations of this one. The paytable is data, so a buyer can retable it; the strategy would have to be rewritten, and shipping a wrong one would be worse than shipping none.
interesting feature and a poor thing to half-build.
draw rules. The shipped table reports and credits the exact win immediately instead of promising an unimplemented gamble feature.
7. Achieved figures
Exact — no sampling
These come from complete enumeration of the draw and carry no error bar:
| Hold | Exact value, coins per coin |
|---|---|
| Made straight flush, held pat | 50.0000 |
| Made royal, held pat at 5 coins | 800.0000 |
| A-K-Q-J-3 all hearts: keep the made flush | 6.0000 |
| A-K-Q-J-3 all hearts: break it for four to the royal | 18.4255 |
| 4-card flush | 1.2128 |
| Low pair | 0.8237 |
| 4-card open-ended straight | 0.6809 |
The first pair proves the game's most counter-intuitive play: throwing away a paying flush to chase the royal is worth three times as much. The last three prove the two rungs that get inverted more often than all the others put together — a 4-card flush beats a low pair, and a low pair beats a 4-card open-ended straight.
The flush draw is also checked against its arithmetic directly: holding four hearts, exactly 9 of the 47 unseen cards complete it, and the computed EV matches 9/47 × 6 + 3/47 × 1 to nine decimal places. That is the assertion that would catch a reshuffle before the draw.
Measured — the return
| Figure | Measured | Published |
|---|---|---|
| 9/6 return, shipped strategy | 99.075 % ± 0.295 pp (2 M hands) | 99.5439 % (optimal play) |
| 8/5 return, shipped strategy | 96.958 % | 97.30 % (optimal play) |
| Cost of the shorter paytable | 2.27 pp | 2.24 pp |
| Hit frequency | 23.96 % | — |
| Standard deviation | 4.17 × stake | — |
The gap between 99.075 % and 99.5439 % is the shipped strategy, not a fault in the game: a chart you can memorise is not per-hand optimal play. What matters is that the gap is quantified rather than assumed, and it is — the strategy is checked against exhaustive optimal play hand by hand:
39 of 40 sampled hands played exactly optimally, giving up an average of **0.0015 coins per
hand** where it differed.
The single disagreement holds three to a flush, a rung the memorisable chart deliberately omits.
An earlier version of the chart scored 36/40 and gave up 0.0157 coins per hand, returning 98.71 %. Three ordering faults caused it, and the exhaustive check is what found them: three to a royal was ranked below both a low pair and a 4-card flush (it belongs above both), and there was no rung for three to a straight flush or for a suited ten with a high card, so hands with no pair and no high card fell straight through to discarding all five.
The 8/5 comparison is the paytable's own proof. Dropping the full house from 9 to 8 and the flush from 6 to 5 costs 2.27 percentage points measured, against 2.24 published — two rows, and they are the whole difference between a good machine and a bad one.
8. Worked examples (become the first unit tests)
- Four to a royal beats a made flush. Holding the four royal cards and breaking a paying flush
- A low pair beats a 4-card open-ended straight, and a 4-card flush beats a low pair.
- Jacks or better pays; tens or worse does not. A pair of tens returns nothing.
- The draw comes from 47 cards. Holding four hearts, exactly 9 of the 47 complete the flush.
- Holding all five of a dealt straight flush draws nothing and pays 50 per coin.
- The 5-coin royal pays 4,000, not 1,250.
is correct, and it is the single most counter-intuitive rung in the strategy.
9. Definition of done
Tracked against the 16-point checklist in the Adding a Game section in this guide.
Coin Flip / Double or NothingCasual · cas_coinflip+
Family: Casual · Complexity: S · Phase 2 · Reference RTP: 99.00 % (1 % house edge, configurable)
Written before any code, per the Adding a Game section in this guide step 1.
1. The game
The player stakes an amount and calls heads or tails. A fair coin is flipped.
- Correct call — the stake becomes a streak value multiplied by the payout multiple.
- Wrong call — the entire streak value is lost and the round ends.
- Collect — the current streak value is returned and the round ends.
The player may then collect the current value, or flip again to risk it all on another call.
A round therefore ends in exactly one of three ways: the player busts, the player collects, or the player reaches the configured maximum streak (which collects automatically).
2. Bets
| Bet | Payout |
|---|---|
| Heads | streak value × payout multiple on a correct call |
| Tails | streak value × payout multiple on a correct call |
There are no side bets.
3. The math
A coin flip is a p = 0.5 event. For a game with house edge e, the fair payout multiple is
multiple = 2 × (1 − e)
At the default 1 % edge that is 1.98×. Expected return per flip:
EV = 0.5 × 1.98 + 0.5 × 0 = 0.99
Per flip the return is 0.99. Because each flip re-risks the entire value, the return of a round in which the player takes n flips before collecting is
RTP(n) = 0.99ⁿ
so 99.00 % for one flip, 98.01 % for two, and 95.10 % for a five-flip run. The edge compounds; it is not amortised. This is the single most important fact about streak games and it is easy to state backwards, so it is worth being explicit: a player who always runs to the maximum streak gets a materially worse return than one who collects early.
Consequences for the product:
- The headline "99 % RTP" figure is the per-flip figure and must be labelled as such wherever
MaxStreakis therefore a real economy lever, not merely a safety cap. Raising it raises the- The RTP test asserts the per-flip figure tightly and the five-flip figure separately, so a
it is shown — in the paytable panel and in the store listing.
house's take from players who chase.
change that breaks the compounding shows up as a specific failure.
Rounding
Streak values are integer credits. Money.MulRatio(value, 198, 100, Rounding.Down) truncates, which is house-favouring by at most one credit per flip. At the minimum stake this is a measurable extra edge, so the RTP test asserts against the measured value with the documented tolerance rather than assuming exactly 99 %.
4. Sources consulted
- Stake Flip — heads/tails selection, a climbing multiplier, an explicit cash-out decision,
- Stake's official Flip guide — confirms that each correct prediction can be banked or risked
- Shuffle Coinflip — a single 50/50 call at 1.96×, continuous chaining, retained history and
- BC.Game Coin Flip announcement — confirms the familiar heads/tails presentation and the
retained history and a finite maximum chain. <https://stake.com/casino/games/flip>
again and that the player controls when to stop. <https://stake.com/blog/how-to-play-flip-on-stake>
fast direct controls. <https://shuffle.com/games/originals/coinflip>
importance of immediate, legible reveal feedback. <https://forum.bc.game/topic/9496-introducing-coin-flip-back-to-basics-with-a-degenerate-touch-up/>
The kit deliberately keeps its already-verified configurable 1.98× reference math while adopting the references' visible chain, cash-out, history and physical-reveal presentation.
5. Deliberate deviations
- Real gamble features frequently offer a red/black card gamble at 2× and a suit gamble at 4×
- The coin is not modelled as biased. A configurable win probability was considered and
in the same panel. Only the 2× coin form is implemented here; the 4× variant is left to the post-v1.0 list because it needs a card view and this game exists to be the simplest possible proof of the framework.
rejected: it makes the game unfair in a way a player could detect, and the edge belongs in the payout multiple where it is visible on screen.
6. Worked example (becomes the first unit test)
Configuration: stake 100 credits, payout multiple 198/100, max streak 3.
| Step | Action | Coin | Streak value | Phase |
|---|---|---|---|---|
| 0 | stake 100 | — | 100 | AwaitingAction |
| 1 | call heads | heads | 100 × 1.98 = 198 | AwaitingAction |
| 2 | call heads | heads | 198 × 1.98 = 392 (392.04 truncated) | AwaitingAction |
| 3 | call tails | tails | 392 × 1.98 = 776 (776.16 truncated) | Finished (max streak) |
Total returned: 776. Net: +676. That outcome has probability 1/8, so this strategy's return is 776 ÷ 100 ÷ 8 = 97.00 %, which is 0.99³ as expected.
Bust example: stake 100, call heads, coin lands tails → returned 0, round ends immediately.
Collect example: stake 100, call heads (correct, value 198), collect → returned 198.
7. Second role: the gamble feature
This game's rules core is also the double-up feature offered by all five slots and by video poker. In that role the stake is not taken from the wallet — it is the win the player is choosing to risk — so the host game passes the win amount in as the stake and treats the result as the replacement payout. The core does not know the difference, which is the point of keeping it free of wallet and Unity dependencies.
8. Definition of done
Tracked against the 16-point checklist in the Adding a Game section in this guide.
CrashCasual · cas_crash+
Family: Casual · Complexity: M · Phase 7 · Return: 99 % default (configurable 97–99 %)
Written before any code, per the Adding a Game section in this guide step 1.
1. The construction
The crash point is drawn by the standard inverse-CDF construction the catalogue specifies:
crash = floor(100 × (1 − edge) / (1 − u)) / 100, for uniform u ∈ [0, 1), clamped to ≥ 1.00
This gives P(crash ≥ m) = (1 − edge) / m for every m ≥ 1 — a Pareto tail — and therefore the property the whole game rests on:
Every cash-out target returns exactly 1 − edge. EV(target m) = m × (1 − e)/m = 1 − e.
There is no good target and no bad one. Auto-cashout at 1.01× and riding to 100× are the same bet with different variance, and the tests must show that rather than assert a percentage at one point.
The instant-bust probability is exactly the edge: crash clamps to 1.00 when u < e, and a 1.00 crash pays nobody. The catalogue calls this out explicitly; it is the whole edge made visible in one number.
2. The shipped rule set
| Rule | Shipped value |
|---|---|
| Draw | Integer u of 1,000,000; crash in hundredths, floored, clamped to ≥ 1.00× |
| Target | Auto-cashout, 1.01× to 1,000×, set before the round |
| Edge | 1 % |
| Cap | Crash points cap at 10,000× — above every legal target, so it costs nothing |
The rules core draws the crash point at launch, then enters an interactive decision phase. A bet may cash out manually at the live displayed multiplier, trigger its configured automatic target, or bust when the already-fixed crash point is reached. The climb never selects or changes the outcome, but the timing of a legal manual cash-out is a real rules action with exact settlement.
3. Landmarks of the distribution
| Fact | Value |
|---|---|
| Instant bust (crash = 1.00) | 1.00 % = the edge |
| Median crash | 1.98× — (1−e)/0.5 |
| P(crash ≥ 2×) | 49.5 % |
| P(crash ≥ 10×) | 9.9 % |
| P(crash ≥ 100×) | 0.99 % |
4. Sources consulted
- the game catalog in this guide §25, which specifies the exact formula, the clamp, the explicit
- Stake Crash: live 1.00× climb, manual and automatic cash-out, a 99% return and visible
- Pragmatic Play Spaceman: real-time cash-out decisions, automatic cash-out, partial cash-out
- Shuffle Crash: manual cash-out over a live multiplier with persistent recent crash results.
instant-bust probability, and calls it "the standard inverse-CDF construction".
previous-round history. <https://stake.com/casino/games/crash>
and prominent round statistics/history. <https://www.pragmaticplay.com/en/games/spaceman/>
<https://shuffle.com/games/originals/crash>
5. Deliberate deviations
- Manual cash-out is a rules action. The outcome was decided at the draw, but the rules core
- No partial cash-out. The shipped one-bet mobile layout keeps one clear decision; the rules
- A second simultaneous bet is table-level — two bets are two rounds on one drawn crash; the
- The fake-social feed is config-gated off and is not a rules concern.
validates the displayed live multiplier against that point and settles the wager immediately.
core still supports multiple bets sharing one crash point.
core supports multiple bets on one slip for exactly this.
6. Achieved figures
The identity, counted exactly
The draw space is a million values, so P(crash ≥ m) is counted, not sampled. At every tested target from 1.01× to 1,000×, the realised return is 99.0000 % — six digits, no error bar:
| Target | Winning draws | Realised |
|---|---|---|
| 1.01× | 980,198 | 99.0000 % |
| 1.98× | 500,000 | 99.0000 % |
| 10× | 99,000 | 99.0000 % |
| 100× | 9,900 | 99.0000 % |
| 1,000× | 990 | 99.0000 % |
The 1.98× row doubles as the median assertion: exactly half of all draws reach it, because the median of the (1−e)/m tail is 2(1−e).
Two numbers that are easy to conflate — and were
- Clamped draws (raw crash below 1.00, forced up): exactly 10,000 of a million = the edge,
- Draws displaying 1.00×: 19,802, because crashes in [1.00, 1.01) floor to 100 naturally.
the catalogue's "instant-bust probability = edge".
Both pay nobody (the minimum target is 1.01×), and the per-target identity is unaffected — but the first test asserted the second number equalled the first, and the exact count said otherwise. The test now asserts both, correctly, with the derivation in the comment.
The rules core
Measured over 400,000 rounds per target at 1.01×, 1.98×, 10× and 100×: each within its binomial standard error of 99 % (tolerance scaled per target, as in dice). Two bets on one slip are asserted to ride the same crash — the catalogue's "second simultaneous bet" is another slip entry, not another draw. A legal manual 1.50× cash-out pays exactly 1,500 on a 1,000 stake, while an attempt beyond the fixed crash point is rejected. The visible curve remains a deterministic replay of the draw, keeping the round verifiable without reducing cash-out to fake presentation.
7. Worked examples (become the first unit tests)
- The identity holds at every target: W(m) winning draws of 1,000,000, W(m) × m within one
- Instant bust is exactly 10,000 of 1,000,000 draws.
- The median crash is 1.98×.
- Crash is never below 1.00× and never above the cap.
- Two bets on one round see the same crash.
- Measured return at 1.01×, 2×, 10× and 100× targets all ≈ 99 %.
draw of 0.99 × 100,000,000 — counted exactly, not sampled.
8. Definition of done
Tracked against the 16-point checklist in the Adding a Game section in this guide.
Dice Over/UnderCasual · cas_dice+
Family: Casual · Complexity: S · Phase 7 · Return: 99 % default (configurable 97–99 %)
Written before any code, per the Adding a Game section in this guide step 1.
1. The shipped rule set
| Rule | Shipped value |
|---|---|
| Roll | An integer in 0–9999, shown as 0.00–99.99 |
| Choice | A target, and over or under |
| Under wins | roll < target |
| Over wins | roll > target |
| Payout | (1 − edge) / winChance, in thousandths |
| Win-chance clamp | 2 % to 98 % |
| Edge | 1 % default |
The target itself is neither over nor under — an exact hit loses either bet. That asymmetry is what makes "under 50.00" a 50.00 % chance and "over 50.00" a 49.99 % chance, and both must price correctly from their own probabilities.
2. The whole game is one identity
Every bet, at every target, must satisfy
winChance × payout = 1 − edge
exactly. The payout curve, the slider readout, the auto-bet maths — all of it is this identity read in different directions. The tests therefore assert it across the entire slider range rather than at a few sample targets.
The clamp exists because the identity misbehaves at the ends: a 0.01 % win chance prices at 9,900×, and a stray rounding thousandth there is worth real money.
3. Rounding is stated, and it favours the house
Payouts are stored in thousandths and rounded down. The realised return at any target is therefore winChance × floor(1000(1−edge)/winChance) / 1000 — at or below the configured target, never above, and closest to it where payouts are large. The tests measure the worst shortfall across the full range rather than pretending the floor away.
4. Sources consulted
- Stake Dice — a 100-sided virtual die with Roll Under / Roll Over, a movable target and live
- Shuffle Dice — a 0–100 track that discloses target, winning side, chance and payout together,
- Stake Primedice — the same direct over/under probability contract, range control and live
- the game catalog in this guide §28, which specifies this kit's exact integer formula, clamp and
win-chance/multiplier controls at 99% RTP. <https://stake.com/casino/games/dice>
with a slider and retained recent outcomes. <https://shuffle.com/games/originals/dice>
multiplier quote. <https://stake.com/casino/games/primedice>
0.00–99.99 roll range.
5. Deliberate deviations
- Auto-bet is table-level. Martingale staking changes no probability; the rules core prices
- Roll precision is fixed at 1/10,000. The catalogue allows it configurable; a finer roll
single rolls.
changes nothing about the identity and the UI shows two decimals regardless.
6. Achieved figures
The identity, asserted 19,200 times
winChance × payout ≤ 0.99 is asserted at every legal target in both directions — roughly 9,600 pricing checks per direction — with the worst rounding shortfall measured:
| Pricing resolution | Worst shortfall |
|---|---|
| Thousandths (first attempt) | 0.097 points |
| Ten-thousandths | 0.0097 points |
Thousandths failed at the high-chance end, which is the non-obvious direction: a 97.7 % bet pays ≈1.012×, and flooring that in thousandths costs up to a full thousandth of the stake — at a 97.7 % win rate, ~0.1 points of return. Keno hit the same wall from the same side (small payouts, frequent hits). Resolution must be finest where payouts are smallest.
Headline payouts
| Bet | Chance | Pays |
|---|---|---|
| Under 50.00 | 50.00 % | 1.9800× |
| Over 50.00 | 49.99 % | 1.9803× |
| Under 2.00 (clamp floor) | 2.00 % | 49.5× exactly |
| Under 98.00 (clamp cap) | 98.00 % | 1.0102× |
Over and under at the same target genuinely differ — the exact hit belongs to neither side, and at ten-thousandths that asymmetry is visible in the payout rather than rounded away. The test asserts underUnits + overUnits = 9,999, never 10,000: that one roll is the house's asymmetry.
Measured over 400,000 rolls per target
Five targets from the clamp floor to the cap, each within its own binomial standard error of the identity (tolerance scaled per target — a 2 % bet at 49.5× has 3SE of 3.3 points, a 98 % bet 0.07 points; one loose global tolerance would prove nothing at the tight end).
An exact hit is asserted to lose both directions by replaying the same seed on each side.
7. Worked examples (become the first unit tests)
- Under 50.00 pays 1.98× at a 1 % edge — 0.5000 chance, 990/500.
- Over 50.00 pays 1.980×… wait, 1.9803× — 0.4999 chance, and the difference from under is real.
- An exact hit loses both directions.
- Targets outside the 2–98 % clamp are refused.
- winChance × payout = 0.99 across every legal target, to the rounding floor.
- The measured return at several targets matches the identity.
8. Definition of done
Tracked against the 16-point checklist in the Adding a Game section in this guide. The authored table now includes a directly draggable risk track with a colored winning region, target and animated landing markers, physical four-digit tumble, exact stake-adjusted potential return, exact final return/net disclosure, six-result history, truthful ROLL/SKIP/ROLL AGAIN action state, aligned dice-impact audio and a bespoke portrait/landscape composition.
Hi-Lo CardsCasual · cas_hilo+
Family: Casual · Complexity: M · Phase 7 · Return: 99 % default (configurable 97–99 %)
Written before any code, per the Adding a Game section in this guide step 1.
1. The defining property: odds from the actual deck
A card is shown; the player bets the next is higher or lower. The payout is computed from the actual composition of the remaining deck — not a fixed table. Show a king and "higher" prices at long odds because only aces beat it and the deck knows how many are left.
That makes the displayed odds always true, turns card counting into a feature (the deck panel is information the maths already uses), and means the pricing identity must hold per state, not merely on average:
P(win | deck state, shown card, choice) × payout = 1 − edge
2. The shipped rule set
| Rule | Shipped value |
|---|---|
| Deck | 1, dealt through; reshuffle when exhausted |
| Equal card | Push for the streak run — stake neither grows nor dies (configurable: push / lose) |
| Streak | Each correct guess multiplies the running value; cash out any time |
| Skip | Up to 52 free skips per run (designer-configurable); consumes one card, preserves value/streak |
| Edge | 1 % per step |
| Aces | High — an ace beats a king; nothing beats an ace |
Ties push by default: the card is consumed, the running value is unchanged, the run continues. "Lose on tie" is the config that shifts the game toward the house and is priced identically — the tie probability simply joins the losing mass.
3. Streaks compound the identity
Each step multiplies the running value by (1 − edge) / P(win at that state). A streak's total multiplier is the product of its steps' inverse probabilities with the edge applied at every rung, so an n-step run returns (1 − edge)ⁿ of fair — the same compounding the coin flip's streak has, priced per state instead of at a constant half.
Cashing out is always exact: the running value is banked money, not a promise.
4. Sources consulted
- the game catalog in this guide §29, which specifies deck-composition pricing ("the odds shown
- Stake HiLo — higher/lower choices, live probabilities, multiplier progression, cash-out,
- Shuffle HiLo — visible active card, a retained row/deck metaphor, growing multiplier,
- Evolution First Person HiLo rules — sequentially revealed cards and explicit
are always true"), the configurable equal-card rule, and the streak ladder as a product of inverse probabilities with the edge applied.
and a skip control on the active card: https://stake.com/casino/games/hilo
rapid manual interaction and cash-out: https://shuffle.com/games/originals/hilo
higher/lower/same results: https://cms.rationalcdn.com/v3/assets/blteecf9626d823b23b/blt940ac4877d549749/First_Person_HiLo.pdf
5. Deliberate deviations
- Skip is capped. Stake-style play allows a long sequence of free skips; this kit exposes the
- The push rule consumes the card. Some variants redraw instead; consuming keeps the deck
- Same-rank "higher" on an equal card is not a win under either shipped rule — the catalogue
cap to designers (52 by default) so a product can shorten the interaction without touching math.
count monotone and the reshuffle policy trivial.
allows a third variant and it is not shipped.
6. Achieved figures
The per-state identity
winChance × payout ≤ 0.99 is asserted at every shown rank, both directions, under both tie rules — the whole point of pricing from the live deck is that the identity holds per state, and that is what is checked, with the flooring shortfall bounded at 0.001.
A hand-stripped state proves the pricing reads the deck, not a table: with three aces removed, a shown king prices "higher" at exactly 44.55× — one live ace of 45 resolving cards under the push rule — and the applied multiplier is asserted equal to the one that was quoted before the guess, which is the "odds shown are always true" claim made executable.
Measured return
One-step runs over 300,000 rounds, guessing whichever side is likelier: 99.033 % against the 99 % target. Per-state pricing realises the configured edge regardless of which side is guessed — there is no "good side" to find, which is the design working.
Rules proven, not described
- A tie pushes under the push rule: card consumed, value unchanged, run continues — and
- An unwinnable guess is refused: "higher" on a shown ace cannot be bet, with the refusal
- The deck panel always sums to the cards remaining throughout multi-step runs — the panel and
- A guaranteed guess pays 0.99×: risk-free costs the edge. The first test draft assumed a won
- Cash-out banks exactly the running value, and the streak cap forces collection.
- Skip consumes exactly one card while preserving stake, value and streak, and the configured
loses under the lose rule, both found and asserted through real deals.
message pointing at the deck panel that already showed zero.
the pricing are the same numbers, so drift would break the game's honesty, not just its UI.
step must grow the value and was wrong; the identity is exact equality with the quote, including when the quote is below 1×.
cap is enforced by both the rules and the authored control.
7. Worked examples (become the first unit tests)
- Showing a 2, "higher" is 46/49 after two deals — the pricing must read the real deck.
- Showing an ace, "higher" prices at zero win chance and must be refused as a bet.
- The per-state identity holds at every reachable state of a fresh deck.
- A tie pushes: card consumed, value unchanged.
- A two-step streak returns 0.99² of fair.
- Cash-out banks exactly the running value.
- The deck panel's counts always sum to the cards remaining.
8. Definition of done
Tracked against the 16-point checklist in the Adding a Game section in this guide.
MinesCasual · cas_mines+
Family: Casual · Complexity: S · Phase 7 · Return: 99 % default (configurable 97–99 %)
Written before any code, per the Adding a Game section in this guide step 1.
1. The shipped rule set
| Rule | Shipped value |
|---|---|
| Grid | 5 × 5, 25 tiles |
| Mines | 1–24, placed uniformly at random |
| Reveal | Pick any unrevealed tile; a mine loses the stake |
| Ladder | After k safe reveals, value = stake × (1 − edge) × C(25, k) / C(25 − m, k) |
| Cash out | Any time; a full clear (all 25 − m safe tiles) collects automatically |
| Edge | 1 %, applied once to the whole ladder |
2. Why the formula is what it is
Surviving k uniformly-chosen reveals has probability C(25 − m, k) / C(25, k) — the chance all k picks land among the safe tiles. The fair multiplier is its inverse; the edge scales it once.
Two consequences worth stating because they are the testable heart of the game:
- Every fixed strategy returns exactly 1 − edge. "Reveal k tiles then cash out" has
- Which tile you pick is irrelevant. Mines are uniform, so tile choice is pure theatre — the
EV = P(survive) × multiplier = (1 − edge), for every k and every mine count. There is no good corner of the config space, which is the design working.
rules core must make that true (uniform placement) rather than merely claim it.
The edge is applied once, not per step — (1 − edge) × C/C, exactly as the catalogue writes it. Compounding per step would make deep ladders drastically worse than shallow ones and break the fixed-strategy property above.
3. The ladder's extremes
| Mines | Full clear (k = 25 − m) | Multiplier |
|---|---|---|
| 1 | 24 safe reveals | 24.75× |
| 5 | 20 reveals | 52,598.7× (0.99 × C(25,20)) |
| 12 | 13 reveals | ~5.1M× |
| 24 | 1 reveal | 24.75× |
The 24-mine game is a single-pick 1-in-25 shot paying 24.75× — the same 0.99 identity at the sharpest point of the config space, and priced by the same formula with no special case.
4. Sources consulted
- the game catalog in this guide §27, which specifies the exact formula
- Stake Mines — a 5×5 manual-pick grid, selectable 1–24 mine count, rising multiplier after
- Stake's official Mines guide — documents the bet → mine-count → tile-pick → cash-out loop and
- Pragmatic Play Mines+ — confirms the same diamond/mine reveal language, increasing multiplier,
multiplier(k) = (1 − edge) × C(25, k) / C(25 − m, k), the 1–24 mine range and cash-out.
every diamond, cash-out decision and 99% return. <https://stake.com/casino/games/mines>
the increasing risk/reward after every safe reveal. <https://stake.com/blog/how-to-play-mines-on-stake>
player-controlled cash-out and full-board maximum-win objective. <https://www.pragmaticplay.com/en/arcade/mines/>
5. Deliberate deviations
- Auto-pick is table-level — it picks a uniformly random tile, which by §2 changes nothing.
- Grid size is fixed at 5 × 5. The catalogue allows it configurable; the formula generalises
trivially and the config surface stays smaller for it.
5.1. Authored table presentation
- BET / RANDOM PICK / PLAY AGAIN is a truthful stateful primary action; Random Pick is a real
- Every safe tile performs a tactile flip, green gem reveal, short glow pulse and dedicated
- The live HUD labels the current multiplier, exact return and safe count, then quotes the next
- Cash-out reveals the remaining mine map, locks exact
safe / multiplier / return / netdisclosure - The board and controls have authored portrait and landscape compositions; controls, stake and mine
live tile choice, not a presentation skip.
non-looping gem cue. A mine performs a red reveal, impact shake and distinct explosion cue.
multiplier, conditional survival chance and exact next return before the player acts.
and stores five prior return / net results. A bust discloses RETURN 0 / NET -stake explicitly.
count lock while a round is live, and no looping background source is introduced.
6. Achieved figures
The identity, all 300 cells
P(survive k) × multiplier(k) ≤ 0.99 is asserted at every cell of the ladder — all 24 mine counts × every reachable depth — with the worst flooring shortfall measured at 0.008 points.
The config space's extremes agree exactly: full-clearing a 1-mine grid and surviving the single pick of a 24-mine grid both pay 24.75× (0.99 × 25), priced by the same formula with no special case. The deep 5-mine clear is 52,598.7× — 990 × 10 × C(25,20) ten-thousandths, exactly.
Monotonicity is asserted across the whole surface: the ladder grows with every reveal and with every added mine.
Placement is uniform, measured
Over 100,000 rounds at 5 mines, every one of the 25 tiles is a mine 20 % ± 0.6 % of the time. Tile choice being pure theatre depends entirely on this, so it is measured rather than assumed.
No fixed strategy beats another
The central design claim, measured over 200,000 rounds each:
| Strategy | Return |
|---|---|
| 3 mines, reveal 2, collect | 99.109 % |
| 10 mines, reveal 5, collect | 96.833 % (±2.5 pp tolerance — this strategy wins 5.6 % of runs at ~17.6×, so its variance is large) |
Both consistent with 99 %. The edge applied once to the whole ladder — not compounded per step — is what makes every reveal-k-then-collect strategy identical in expectation.
Rules proven
- A safe reveal applies exactly the quoted ladder value.
- A mine returns zero and shows all mines; a full clear collects automatically at the closed form.
- Revealed and off-grid tiles are refused; mine counts outside 1–24 are refused.
7. Worked examples (become the first unit tests)
- The multiplier table matches the formula at every (m, k) — all 300 cells.
- P(survive k) × multiplier(k) = 0.99 at every cell — the fixed-strategy identity.
- One mine, 24 reveals pays 24.75×, and so does 24 mines, 1 reveal.
- Each tile is a mine with frequency m/25 over many rounds — uniformity, measured.
- Revealing a mine returns zero; revealing a revealed tile is refused.
- A full clear collects automatically at the closed-form value.
- The quoted next-step value equals the applied one.
8. Definition of done
Tracked against the 16-point checklist in the Adding a Game section in this guide.
PlinkoCasual · cas_plinko+
Family: Casual · Complexity: M · Phase 7 · Return: 99 % default (configurable 97–99 %)
Written before any code, per the Adding a Game section in this guide step 1.
1. The walk is computed, not simulated by physics
A ball falls through n rows of pegs (8–16, default 12), going left or right at each row with probability ½. The path is a deterministic binomial walk drawn by the rules core — the final bucket is simply the number of right-moves, so bucket k of n has probability
P(k) = C(n, k) / 2ⁿ
The catalogue is explicit about why: physics is non-reproducible, non-verifiable and cannot hit a target RTP. The presentation animates the recorded path; it never decides it.
2. The multiplier array is a shape, normalised
Same solved-table pattern as keno, scratch and lotto: each risk profile (low / medium / high) supplies a shape — how brutal the centre is, how tall the edges are — and the scale is solved so
Σ P(k) × multiplier(k) = 1 − edge
exactly. Changing the risk changes the distribution of the return, never the return. Multipliers are stored in ten-thousandths, floored, for the reasons dice established: the centre buckets of a low-risk profile pay barely under 1× and coarse flooring eats real return exactly there.
3. The shipped profiles (12 rows) are curated, not generated
| Profile | Centre | Edge buckets |
|---|---|---|
| Low | 0.5× | 10× |
| Medium | 0.3× | 33× |
| High | 0.2× | 170× |
All three return 99 % after normalisation. The edge buckets land 2 in 4,096 each.
A generated curve was tried first and failed the feel test: to make the far tail spike, the mid buckets have to pay near the centre's value, and any smooth polynomial or exponential instead spreads the money through the mid buckets — dragging the centre to 0.17× and capping the edge at 11×. Real plinko tables are hand-shaped for exactly this reason, so the 12-row shapes ship from that family. Other row counts fall back to a generated curve; normalisation guarantees their return regardless — only the 12-row feel is curated.
4. Sources consulted
- Stake Plinko — 8–16 rows, selectable risk, visible edge/centre multiplier pots and a
- Pragmatic Play Plinko+ — 8–16 lines, low/medium/high risk and larger awards on the harder
- Hacksaw Gaming Plinko — configurable risk/rows, repeated balls and exact
- the game catalog in this guide §26, which specifies the binomial construction,
physical peg-pyramid drop: <https://stake.com/casino/games/plinko>.
outer buckets: <https://www.pragmaticplay.com/en/arcade/plinko/>.
stake-times-bucket payout: <https://www.hacksawgaming.com/games/plinko>.
normalise-to-target requirement and deterministic-path rule used by this kit.
5. Deliberate deviations
- The walk is fair (p = ½). The catalogue says "biased binomial"; the bias knob exists in the
- Multi-ball is table-level. N balls are N rounds.
maths but nothing in the shipped config uses it — a fair walk with a normalised table already hits any target return, and a hidden bias is exactly the kind of thing a buyer should not inherit silently.
6. Achieved figures
Normalisation
Every risk profile at every even row count 8–16 returns 99 % to within 0.1 points of flooring. The curated 12-row tables land, after normalisation:
| Profile | Centre | Edge |
|---|---|---|
| Low | 0.5001× | 10.002× |
| Medium | 0.3× | 33× |
| High | 0.1997× | 169.8× |
Same return, wildly different distribution — asserted directly: the high edge dwarfs ten times the low edge while the two profiles' expected returns agree to 0.1 points. Symmetry is asserted for every profile: bucket k and bucket n − k always pay the same.
The walk
- The bucket always equals the number of rights in the recorded path — 2,000 rounds asserted
- The measured bucket distribution is binomial: over 400,000 drops, every one of the 13
- The event stream is asserted to replay the recorded path bounce for bounce.
cell by cell. The presentation replays this path; nothing else may decide the outcome.
buckets within 0.06 points of C(12,k)/4096 — including the 1-in-4,096 edges.
Two faults found on the way
A generated shape failed the feel test (documented in §3): smooth curves cannot produce both a livable centre and a real cliff, because the binomial's mid-bucket mass soaks up the scale. The 12-row shapes are curated from the standard table family instead — and the first curated attempt was mirrored backwards (edge values at the centre), caught immediately by the centre-pays-under-1× assertion. Half-tables are now explicitly indexed by distance from centre.
Authored physical presentation
The 12-row reference table contains 78 reachable pegs, not the former offset 90-peg decoration. Each PegBounced event lights exactly one authored peg, plays one non-looping impact cue and drives the gold ball/trail along the recorded path. The thirteen pots disclose the current risk table, and the final HUD states the exact multiplier, returned credits and signed net. The authored-scene gate also proves skip and natural completion settle the same rules result.
7. Worked examples (become the first unit tests)
- The binomial buckets sum to 1 for every row count 8–16.
- Every risk profile returns 99 % after normalisation, to the flooring.
- A symmetric shape yields symmetric multipliers.
- The bucket equals the number of rights in the recorded path, always.
- The measured bucket distribution matches C(n,k)/2ⁿ.
- Changing the risk does not change the return.
8. Definition of done
Tracked against the 16-point checklist in the Adding a Game section in this guide.
Bingo (75 & 90 ball)Lottery · lot_bingo+
Family: Lottery · Complexity: L · Phase 6 · Return: configurable by design
Written before any code, per the Adding a Game section in this guide step 1.
1. The shipped rule set
| Rule | 75-ball | 90-ball |
|---|---|---|
| Card | 5 × 5, free centre | 9 × 3, 15 numbers |
| Pool | 75 balls | 90 balls |
| Column ranges | B 1–15, I 16–30, N 31–45, G 46–60, O 61–75 | col 1 = 1–9, cols 2–8 by decade, col 9 = 80–90 |
| Row rule | 5 per row | exactly 5 per row, 4 blanks |
| Patterns | line, four corners, X, plus, blackout | one line, two lines, full house |
| Draw | Balls without replacement, to a configurable cap |
Only one player. There is no race against a room, so a prize pays whenever its pattern completes inside the ball cap — which is what makes the return computable at all.
2. Card generation is a constraint, not a shuffle
A 75-ball card is not 24 numbers drawn from 75. Each column draws from its own range of fifteen, without duplicates. Generating a card any other way produces cards that cannot occur.
A 90-ball ticket is stricter still: 15 numbers on a 9 × 3 grid with exactly five per row, each column holding its own decade, and no column empty. Those constraints interact — a naive generator deadlocks or produces illegal tickets — so the generator is validated rather than trusted.
3. The exact mathematics: balls to complete a pattern
For a pattern needing k specific numbers from a pool of N, drawn without replacement, the chance all k have appeared within the first n balls is
P(complete by ball n) = C(n, k) / C(N, k)
and the expected ball on which the last of them arrives is
E[balls] = k (N + 1) / (k + 1)
Both are closed forms. A single line, four corners and a blackout are each exact.
"Any line" is not, and the difference matters. Twelve lines on a 75-ball card overlap — five rows, five columns, two diagonals, sharing cells — so the probability that at least one completes is a union, and inclusion–exclusion over twelve overlapping sets is not worth the code. That figure is measured, and the exact single-line probability is asserted as a bound on it: any-line must be more likely than one line and cannot exceed twelve times it.
4. Sources consulted
- Published bingo card specifications — the 75-ball column ranges and free centre, and the
- the game catalog in this guide §22, which specifies the shipped feature set: the pattern list as
90-ball 9 × 3 layout with five numbers per row and one decade per column. These are the rules the generator is validated against.
data, the prize table per pattern, and the ball-draw cap.
There is no published house edge to match — like the bonus wheel, the return is designed. What is verifiable is the mathematics of the draw, and that is exact.
5. Deliberate deviations
- No competing players. Multiplayer bingo is a race, and the prize goes to whoever completes
- No manual-daub miss penalty. The catalogue lists it as an option; it changes the return by an
- Prizes pay once each. A card that makes two lines on the same ball collects the two-line prize
first; that is a networking feature, not a maths one. Single-player bingo pays on completion.
amount that depends on player reflexes, which is not something a paytable can express.
once, not twice.
6. Achieved figures
The closed form, exact
| Pattern | Numbers needed | Expected completion ball |
|---|---|---|
| Four corners | 4 | 60.80 |
| A line through the free centre | 4 | 60.80 |
| A line not through the centre | 5 | 63.33 |
| Blackout | 24 | 72.96 |
A blackout completes on ball 72.96 of 75 on average — almost the entire pool. That single figure explains why blackout prizes are large and why a 40-ball cap makes them nearly unreachable.
The minimum-length blackout — the first 24 balls being exactly the card's 24 numbers — has probability exactly 1 / C(75, 24) = 3.8792 × 10⁻²⁰, and the test asserts the computed value against that closed form rather than merely checking it is small.
Measured against exact, 200,000 rounds at a 45-ball cap
| Pattern | Measured | Exact |
|---|---|---|
| Four corners | 12.202 % | 12.258 % |
| Blackout | 0.00000 % | 0.00001 % |
| Any of twelve lines | 63.898 % | not a closed form |
Four corners and blackout are single patterns, so their rates are exact and asserted as such.
"Any line" is deliberately only bounded. Twelve lines on a 75-ball card overlap — five rows, five columns and two diagonals sharing cells — so the probability at least one completes is a union, and inclusion–exclusion over twelve overlapping sets is not worth the code. What the test asserts is that it sits strictly between one line (7.079 %) and twelve times one line (84.9 %), which is everything that can honestly be claimed. Measured 63.9 % sits comfortably inside.
The card generators are validated, not trusted
Over 2,000 generated cards each:
- 75-ball: exactly 24 numbers, a blank centre, and every column inside its own range of
- 90-ball: exactly 15 numbers, exactly five per row, one decade per column, no column
- Numbers within a column read downwards, as on a printed ticket.
fifteen. A card generated by drawing 24 from 75 would pass a "24 distinct numbers" check and still be impossible; the range check is what catches it.
empty and none holding more than three. The two ends are the trap — column 0 holds 1–9 because there is no zero, and column 8 holds 80–90 because ninety has to go somewhere — and a separate test asserts the nine decades cover 1–90 exactly once between them.
The row and column constraints interact, so the generator picks the column sizes first — a composition of 15 into nine parts of 1 to 3 — and places numbers into the emptiest rows. Filling cells one at a time and hoping deadlocks.
Prizes pay once
A pattern is paid on the ball that completes it and never again, asserted by counting completion events per pattern across a full 75-ball draw. The 90-ball full house is separately asserted never to complete before its three lines do.
7. Worked examples (become the first unit tests)
- A 75-ball card has 24 numbers, not 25 — the centre is free.
- Every column holds numbers from its own range, over thousands of generated cards.
- A 90-ball ticket has exactly 5 numbers per row and 15 in total.
- P(blackout by ball 75) = 1, and P(blackout by ball 23) = 0.
- A single line needs 5 numbers; its expected completion is ball 63⅓ of 75.
- Four corners completes sooner than a line — 4 numbers rather than 5.
- Any-line is more likely than one line and less likely than twelve times it.
8. Definition of done
Tracked against the 16-point checklist in the Adding a Game section in this guide.
KenoLottery · lot_keno+
Family: Lottery · Complexity: M · Phase 6 · Target return: 92 % (tunable)
Written before any code, per the Adding a Game section in this guide step 1.
1. The shipped rule set
| Rule | Shipped value |
|---|---|
| Pool | 80 numbers, 1 to 80 |
| Draw | 20 balls, without replacement |
| Player picks | 1 to 10 spots |
| Payout | By the (spots picked, spots hit) pair |
The player picks, the machine draws twenty, and the payout depends only on how many of the picks appear. There are no decisions after the ticket is placed.
2. The probabilities are hypergeometric, and exact
Drawing 20 from 80 without replacement, the chance of hitting exactly k of n picks is
P(k) = C(n, k) × C(80 − n, 20 − k) / C(80, 20)
C(80, 20) is 3,535,316,142,212,174,320 — beyond a signed 64-bit integer — so the kit computes these through log-gamma rather than by dividing factorials. The kernel's Hypergeometric already does this and is shared with lot_lotto and lot_bingo.
Every figure in this game is exact. There is nothing to simulate: the distribution is a closed form and the return is a dot product of that distribution with the paytable.
3. Real keno returns about 75 %. This one returns 92 %.
Casino keno is among the worst bets in existence — typical house edges run from 25 % to 30 %. A social-casino title that reproduced that would feel punishing and pointless, since no real money is at stake.
So the shipped paytable targets 92 %, and the fact that this is a deliberate departure from the real game is stated here rather than left for a buyer to discover. The paytable is data: a buyer who wants authentic 75 % keno edits one asset.
4. Why the paytable must be validated, not typed
A keno paytable is a grid — ten spot counts, each with up to eleven hit counts. Nothing about it is self-checking. A single mis-keyed cell in the 10-spot row changes that ticket's return by several points and nothing else about the game looks wrong.
The editor therefore shows, live, for every cell:
- the exact hypergeometric probability of that (spots, hits) pair, and
- the exact return for that spot count, recomputed as the cell is edited.
That is the whole reason this game is worth shipping in a kit rather than a demo: the tool makes a wrong paytable visible immediately.
5. Sources consulted
- The Wizard of Odds' keno analysis — the hypergeometric formulation, the 1-in-8,911,711 odds
- Published keno rule sheets — the 80-number pool, the 20-ball draw, and payouts by the
of hitting all ten spots, and the 25–30 % house edge range for real casino keno. Confirms the probability model this game is verified against.
(spots, hits) pair.
6. Deliberate deviations
- No way tickets or combination tickets. They split one ticket into several sub-bets and are
- No multi-race tickets in the rules core. Playing the same ticket across N draws is N rounds;
- Max 10 spots. Some houses offer 15 or 20; the paytable grid supports more but the shipped
a betting-surface feature rather than a maths one. Config-gated off, as the catalogue notes.
it belongs to the table, not the maths.
one stops at 10, where published odds are easiest to check against.
7. Achieved figures — exact
Every spot count returns the 92 % target, and every figure is hypergeometric:
| Spots | Return | Edge | All hit |
|---|---|---|---|
| 1 | 92.0000 % | 8.0000 % | 1 in 4 |
| 2 | 91.9997 % | 8.0003 % | 1 in 17 |
| 3 | 91.9937 % | 8.0063 % | 1 in 72 |
| 4 | 91.9993 % | 8.0007 % | 1 in 326 |
| 5 | 92.0021 % | 7.9979 % | 1 in 1,551 |
| 6 | 92.0042 % | 7.9958 % | 1 in 7,753 |
| 7 | 92.0010 % | 7.9990 % | 1 in 40,979 |
| 8 | 91.9997 % | 8.0003 % | 1 in 230,115 |
| 9 | 92.0014 % | 7.9986 % | 1 in 1,380,688 |
| 10 | 92.0021 % | 7.9979 % | 1 in 8,911,711 |
Ten rows, one return. The ten-spot figure matches the published 1 in 8,911,711 exactly.
The paytable is solved, not typed
Each row is generated from a shape — relative payouts, which decide how the ticket feels — scaled by a factor solved so the row returns the target. The two are independent, and the tests assert that independence in both directions:
- Changing the target moves every row together. Rebuilding at 80 % puts all ten rows at 80 %.
- Changing the shape does not change the return. The 10-spot row was rebuilt with almost
everything loaded onto hitting all ten — a top prize over five times the shipped one — and it still returns 92.0 %.
A shape that pays nothing on any reachable hit count is refused rather than silently producing a zero row.
Thousandths, not hundredths
Payouts are stored in thousandths of the stake. Hundredths were tried first and were not enough: the 3-spot row pays about 1.89× on two hits, which happens 13.9 % of the time, so rounding that one cell to 1.89 cost 0.06 percentage points of return on its own.
| Resolution | Worst row error |
|---|---|
| Hundredths | 0.062 points |
| Thousandths | 0.006 points |
The test measures the worst error across all ten rows rather than assuming rounding is negligible.
The rules core is checked against the closed form — carefully
Two separate checks, because one number could not do both jobs:
- The draw, at six spots over 400,000 rounds: every hit count within 0.4 points of its exact
- The return, at two spots over 400,000 rounds: 92.001 % measured against 92.000 % exact.
probability.
The return check deliberately uses a 2-spot ticket. A 6-spot ticket's return is dominated by a 1,800× prize landing 13 times in 100,000 — a handful either way moves the measured return by whole percentage points, and 400,000 rounds is nowhere near enough to pin it down. Measuring the return where variance is low and the draw where variance is low gives two tight claims instead of one loose one.
8. Worked examples (become the first unit tests)
- Hitting all 10 of 10 spots is 1 in 8,911,711.
- The distribution for any spot count sums to exactly 1.
- A 1-spot ticket hits 20/80 of the time — exactly a quarter.
- The expected number of hits on an n-spot ticket is n/4, for every n.
- Every spot count returns within a point of the 92 % target.
- Changing one paytable cell changes exactly one spot count's return.
9. Definition of done
Tracked against the 16-point checklist in the Adding a Game section in this guide.
Lotto Draw 6/49Lottery · lot_lotto+
Family: Lottery · Complexity: M · Phase 6 · Return: configurable (fixed-prize model)
Written before any code, per the Adding a Game section in this guide step 1.
1. The shipped rule set
| Rule | Shipped value |
|---|---|
| Pool | 49 numbers, 1 to 49 |
| Player picks | 6, no duplicates |
| Draw | 6 main balls plus one bonus ball from the remaining 43 |
| Prize tiers | 3, 4, 5, 5+bonus, 6 matches |
| Model | Fixed prizes (a pari-mutuel pool model is a deliberate deviation, §6) |
2. The odds are combinatorial, and exact
Matching exactly k of 6 picks when 6 are drawn from 49 is hypergeometric:
P(k) = C(6, k) × C(43, 6 − k) / C(49, 6)
with C(49, 6) = 13,983,816 — the famous figure. The bonus ball splits the 5-match tier: of the C(6,5) × C(43,1) = 258 ways to match exactly five, exactly 6 have the sixth pick as the bonus ball (one per choice of which pick was missed... precisely: the missed pick must be the bonus, so 6 of the 258), giving:
| Tier | Ways (of 13,983,816) | Odds |
|---|---|---|
| Match 6 | 1 | 1 in 13,983,816 |
| Match 5 + bonus | 6 | 1 in 2,330,636 |
| Match 5 | 252 | 1 in 55,491 |
| Match 4 | 13,545 | 1 in 1,032 |
| Match 3 | 246,820 | 1 in 56.7 |
Every figure in this game is exact — the same hypergeometric machinery as keno, plus one conditional step for the bonus ball.
3. The prize tiers are solved, like keno's and scratch's
Real 6/49 lotteries return around 45–50 %, which would feel punishing in a social title. The kit ships the same solved-table pattern as its siblings: the designer supplies the tier shape (relative prize sizes) and a target return, and the scale is solved exactly. The default target is 70 % — lottery-shaped (rare huge prizes, mostly losses) but not real-lottery cruel — and, as with keno, the deviation from reality is stated rather than discovered.
4. Sources consulted
- The Wizard of Odds' lottery analysis — the 1 in 13,983,816 jackpot odds, the hypergeometric
- Published 6/49 rules (UK National Lottery historic format, Canada 6/49) — the bonus ball
tier probabilities, and the 45–50 % return range of real 6/49 lotteries.
drawn from the remainder and applied only to the 5-match tier.
5. Why the bonus-ball arithmetic is asserted directly
The 5+bonus tier is the one implementations get wrong: the bonus ball is drawn from the 43 remaining numbers, and it only matters when exactly 5 picks matched. Conditioned on that, the missed pick is one specific number of the 43, so P(bonus | match 5) = 1/43 — giving 258 × 1/43 = 6 ways. Tests assert the 6/252 split of the 258, not just the headline odds.
6. Deliberate deviations
- No pari-mutuel pool model. Splitting a pool among winners needs a population of other
- Return targeted at 70 %, not 45–50 %. Stated as a deviation, tunable to authentic.
- Multi-ticket play is table-level, not rules-core — N tickets are N rounds.
tickets, which a single-player title does not have. Fixed prizes ship; the catalogue notes the pool model as a config option for a future multiplayer context.
7. Achieved figures — exact
The tier table in §2 is asserted in ways, not probabilities — 246,820 / 13,545 / 252 / 6 / 1 of 13,983,816, summing with the losing ways to the whole sample space. Integers cannot hide a normalisation error the way probabilities can.
The 5+bonus split is asserted as the conditional it is: P(bonus | exactly 5) = 1/43, partitioning the 258 exact-5 ways into 252 and 6 with nothing left over.
Solved tables hit their targets:
| Target | Achieved |
|---|---|
| 45 % | 45.0004 % |
| 70 % | 70.0002 % |
| 90 % | 90.0007 % |
At the default 70 % the jackpot pays 5,885,905× the ticket — the shape doing what a lottery shape should, with almost the entire return concentrated in tiers nobody reaches.
The draw is checked against the closed form over 300,000 tickets: match counts 0 through 4 each within 0.07 points of their hypergeometric values. (The jackpot tiers cannot be reached by simulation, which is exactly why the ways-table assertion above exists.)
The bonus ball can never duplicate a main ball by construction — it is the seventh card of one shuffle — and this is asserted over 2,000 draws anyway, because "by construction" claims deserve tests too.
8. Worked examples (become the first unit tests)
- C(49,6) = 13,983,816, computed not hard-coded.
- The five tier ways sum with the losing ways to 13,983,816 exactly.
- Match-5 splits 252/6 on the bonus ball — 258 × 42/43 and 258 × 1/43.
- The tier probabilities sum to 1 with the losing outcomes.
- Every solved tier table returns the target exactly.
- A drawn bonus ball is never one of the six main balls.
9. Definition of done
Tracked against the 16-point checklist in the Adding a Game section in this guide.
Lucky DrawLottery · lot_lucky_draw+
Family: Lottery · Target RTP: 96.00% (house edge 4.00%)
1. The game
The player chooses a stake and draws one capsule from a configured weighted prize table. The outcome is committed by the rules core before presentation begins. The visible raffle machine mixes authored capsules, carries one capsule to the podium, opens it, and reveals that exact outcome. Skipping the animation cannot change the draw or its return.
The prize table is always visible. Every row shows its exact configured probability and payout, so the decorative quantity of capsules inside the chamber is never presented as the odds.
2. Bets and payouts
| Bet | Payout |
|---|---|
| Draw | selected multiplier × committed stake |
Reference table:
| Outcome | Weight | Exact chance | Multiplier |
|---|---|---|---|
| No win | 610 | 61.0% | 0x |
| Small | 300 | 30.0% | 1x |
| Medium | 70 | 7.0% | 3x |
| Large | 15 | 1.5% | 10x |
| Jackpot | 5 | 0.5% | 60x |
Minimum and maximum stakes come from LuckyDrawDefinition.asset; the authored reference ladder is 10, 25, 50, 100, and 250 credits.
3. Exact math
RTP = Σ (weight_i / totalWeight) × multiplier_i
The reference table has total weight 1000 and weighted return 960:
(610×0 + 300×1 + 70×3 + 15×10 + 5×60) / 1000 = 0.96
The rules test computes this exactly. Designers may replace every row; the config inspector, rules snapshot, help disclosure, and visible table all read the same asset.
4. Player help and disclosure
Choose a stake, press Draw Capsule, and watch the selected capsule open. The prize table shows the exact chance and stake multiplier for every possible result. Skip only fast-forwards the presentation. Recent draws are session history, not a prediction of the next independent draw.
5. Reference patterns consulted
- Coin Master — Daily Bonus Wheel
- MONOPOLY GO — Partners Events
confirms one clear activation, a visible random-reward device, immediate prize reveal, and a stronger follow-up state after the first result.
confirms a persistent reward device with readable reward slices, an adjustable committed amount, jackpot emphasis, and a visible landing before reward progression.
Lucky Draw uses a raffle capsule drum instead of copying either wheel. This keeps its silhouette distinct from the kit's Money Wheel and Bonus Wheel while preserving the same strong anticipation, landing, and reveal beats.
6. Deliberate deviations
- Chamber capsule colours are decorative; exact probabilities are printed in the prize table.
- The result is selected once by
LuckyDrawRulesbefore animation. There is no presentation - Session history is capped at five results and resets when the table is reloaded.
physics or timing input that can alter it.
7. Worked example
At a 25-credit stake, drawing Large (10x) returns 250 credits. Wallet change is -25 + 250 = +225. Drawing Small (1x) returns 25 credits, for a net push.
8. Definition of done
- Exact RTP and deterministic outcome tests pass.
- The authored scene contains the drum, at least twelve pooled chamber capsules, travelling
- A watched draw visibly mixes, travels, opens, and lands on the rules outcome.
- Skip lands on the same outcome and leaves every authored element settled.
- Portrait, landscape, localization, help, audio, safe-area, and WebGL release gates pass.
capsule, reveal podium, five-row prize disclosure, and session history.
Scratch CardsLottery · lot_scratch+
Family: Lottery · Complexity: M · Phase 6 · Target return: 90 % (tunable)
Written before any code, per the Adding a Game section in this guide step 1.
1. Decide, then reveal
The outcome is drawn before a single cell is scratched. A weighted prize table decides what the ticket is worth; the grid is then constructed to show that, and the scratching is pure presentation.
This is how real instant lotteries work — a print run has a known prize structure — and it is the only way to guarantee a return. The alternative, rolling each cell live and seeing what happens, has an RTP nobody can state and one that changes with every grid size or symbol-set edit.
the Architecture section in this guide §5 lists the scratch mask as one of only two justified runtime-texture exceptions in the kit. That exception is for the mask, not the outcome.
2. The shipped rule set
| Rule | Shipped value |
|---|---|
| Templates | Match 3, Beat the target, Find the prize |
| Grid | 3 × 3 for match-3 and find-the-prize |
| Prize table | Value × weight rows, plus a losing row |
| Return | 90 %, solved exactly (see §3) |
3. The return is solved, not tuned
The designer supplies prize values and their relative weights. The weight of the losing row is then solved so the table returns the target exactly:
W = Σ wᵢvᵢ / target, and w_lose = W − Σ wᵢ
With the shipped table that gives a total weight of 2,000 against 535 winning weight — a 26.75 % win rate and a return of exactly 90 %, with no rounding anywhere because the arithmetic is integral.
Changing a prize value or a weight re-solves the losing row automatically. A designer cannot accidentally change the return by making the top prize bigger; they change how the 10 % is distributed, which is the decision they actually want to make.
4. The real risk is the grid, not the maths
The RTP is exact by construction, so nothing can go wrong there. What can go wrong is the reveal: a grid built to show a 5× win that happens to also contain three of another symbol is a ticket that pays one thing and reads as another.
So the generator is tested on the property that matters:
- a winning grid contains exactly one three-of-a-kind, and it is the winning symbol;
- a losing grid contains no three-of-a-kind at all.
Both are checked over tens of thousands of generated tickets. A grid filled at random passes neither reliably.
5. Sources consulted
- the game catalog in this guide §23, which specifies this game: the decide-then-reveal
- the Architecture section in this guide §5, which permits the runtime scratch mask as a named
requirement ("this is how real instant lotteries work, and it is the only way to guarantee RTP"), the three templates, and the prize-table-with-weights configuration.
exception and does not extend that to outcome generation.
There is no published house edge to match — instant lotteries publish their own prize structures, and this one is configurable.
6. Deliberate deviations
- No ticket book or collection. That is meta-layer state, not a rule.
- No partial-scratch payout. A ticket is worth what it is worth whether or not the player
- Find-the-prize reveals the prize directly, so it has no consistency constraint to satisfy —
reveals every cell; the reveal-all button exists for that reason.
it is included because it needs none, which makes it the control case for the other two.
7. Achieved figures
The solved table
| Prize | Frequency | Worth |
|---|---|---|
| 1× | 1 in 7 | 1× |
| 2× | 1 in 13 | 2× |
| 5× | 1 in 33 | 5× |
| 10× | 1 in 100 | 10× |
| 50× | 1 in 500 | 50× |
| 500× | 1 in 2,000 | 500× |
Return 90.000000 %, win rate 26.75 % — exact, because the losing weight is solved rather than guessed.
Changing the top prize to 5000× leaves the return at exactly 90.0000 % and raises the total weight from 2,000,000 to 7,000,000: a bigger prize buys more losing tickets behind it. That is the separation the design exists for, and it is asserted rather than described.
Two faults the tests caught
Integer weights made arbitrary targets inexact. At the scale a designer writes — weights of 1 to 300 — rounding the solved total is coarse: a target of 85 % came out at 84.986 %. Weights are now scaled by a thousand before solving, which brings the error to about 2 × 10⁻⁸. Ratios are untouched, so "1 in 2,000" still reads as 1 in 2,000.
The guard was checking the wrong direction. It refused tables whose prizes were too large, which cannot actually happen — losers can always be added. The real failure is prizes too small: a table of half-stake prizes cannot reach 90 % however it is weighted, because even paying every ticket it returns 54.5 %. That now throws with the achievable figure in the message.
A third fault followed from the scaling: the accessors were reading the supplied weights while the total summed the scaled ones, reporting a return of 0.09 % instead of 90 %. Every figure is now computed from one source, and the class says so.
Grid consistency
Over 3,000 winning and 5,000 losing grids:
- every winning grid holds exactly one three-of-a-kind, and it is the symbol the prize is
- every losing grid holds no symbol three times;
- every cell is filled.
tied to;
The filler caps each non-winning symbol at two, which makes a second triple impossible rather than merely unlikely. Filling at random would produce one now and then, and that ticket would pay one prize while reading as another.
A symbol set too small for the grid is refused up front: nine cells with every symbol capped at two needs at least five symbols.
Measured over 200,000 tickets
| Measured | Exact | |
|---|---|---|
| Win rate | 26.704 % | 26.750 % |
| Return | 86.738 % | 90.000 % |
The win rate is the sharper check and converges quickly. The return does not: a 500× prize at 1 in 2,000 contributes a quarter of the whole return, so a handful either way moves it by points. The test asserts the win rate tightly and the return loosely, and says why.
8. Worked examples (become the first unit tests)
- The prize table returns exactly 90 %, by construction, with no rounding.
- The top prize is 1 in 2,000 tickets.
- 26.75 % of tickets win something.
- A winning match-3 grid holds exactly three of the winning symbol and no other triple.
- A losing grid holds no symbol three times.
- Changing a prize value re-solves the losing weight and leaves the return at 90 %.
- The measured return over 200,000 tickets matches the exact one.
9. Definition of done
Tracked against the 16-point checklist in the Adding a Game section in this guide.
Classic 3-Reel FruitSlots · slot_classic3+
Family: Slots · Complexity: M · Phase 3 · Target RTP band: 94.5 – 95.5 %
Written before any code, per the Adding a Game section in this guide step 1.
1. Layout
Three reels, three visible rows, 1 or 3 paylines — centre only, or centre plus top and bottom. Each reel is a 24-position virtual strip; a spin picks one stop per reel independently.
The whole game is a cycle of 24³ = 13,824 equally likely outcomes, so its return is computed exactly by enumeration in a fraction of a second. This is the simplest game in the kit and it is deliberately the one that proves the shared SlotCycleCalculator works for a reel set that is not the video slot's.
2. Symbols
| Id | Symbol | Per strip |
|---|---|---|
| 0 | Cherry | 2 |
| 1 | Lemon | 5 |
| 2 | Orange | 5 |
| 3 | Plum | 4 |
| 4 | Bell | 4 |
| 5 | Bar | 3 |
| 6 | Seven | 1 |
No wild and no scatter. A classic fruit machine has neither, and adding them would make this game a small video slot rather than the thing it is meant to be.
All three reels use the same strip composition, which is what makes the maths legible: the chance of any three-of-a-kind is simply p³.
3. Line wins
Evaluated left to right from reel 1, exactly as the video slot. Three of a kind pays per the table below; lines are summed.
The cherry rule
Cherries pay short — one cherry on reel 1 pays, and two cherries on reels 1 and 2 pay more. This is the defining quirk of classic fruit machines: it gives the player frequent tiny wins and it is where a large slice of the return lives.
It needs no special-casing in the evaluator. PaylineEvaluator already counts the run length from reel 1 and looks up paytable[symbol][count], so a paytable entry at count 1 or 2 simply pays. Only Cherry has such entries, so only Cherry pays short.
4. Paytable
Multiples of the line bet.
| Symbol | 1 | 2 | 3 |
|---|---|---|---|
| Cherry | 1 | 3 | 12 |
| Lemon | — | — | 12 |
| Orange | — | — | 15 |
| Plum | — | — | 26 |
| Bell | — | — | 40 |
| Bar | — | — | 125 |
| Seven | — | — | 800 |
5. Line count does not change the return
Each payline reads one row per reel, and over a uniform stop the marginal symbol distribution is identical for every row. By linearity of expectation the return per line bet is therefore the same whether one line or three are active — only the variance changes.
That is a real property, not an assumption, so there is a test for it: the exact figure is computed for both line counts and asserted equal.
Achieved figures with the shipped configuration
| Total RTP | 95.4138 % (house edge 4.5862 %) |
| Cycle size | 13,824 combinations |
| Hit frequency | 31.07 % |
| Max win | 288.7× total bet |
Worth comparing against slot_video5x3, which returns a near-identical 95.81 % but with a 74 % hit frequency and a 109× ceiling. Same return, completely different game: this one pays about once in three spins and can pay big, the video slot pays constantly and small. That contrast is the clearest demonstration in the kit that RTP alone does not describe how a slot feels — hit frequency and maximum win do — and it is why the video slot's shape is flagged for retuning in its own game rules section.
6. Sources consulted
- Virtual reel strip / full-cycle (par sheet) RTP methodology, as used for the video slot —
- Classic three-reel fruit machine conventions: three reels, one or three paylines, a small
total paid across every stop combination divided by total wagered. Confirms the model and the definition of return used here.
symbol cast with no wild or scatter, a top symbol paying a four-figure multiple, and cherries paying on one and two symbols. Confirms both the layout and the cherry rule.
7. Deliberate deviations
- No nudge or hold. UK-style fruit machines often let the player hold reels or nudge one
- No progressive jackpot. The Seven pays a flat 800×.
position, which changes the maths substantially (it makes the game partly skill-based). Out of scope; the payout model here is the straightforward one.
8. Worked examples (become the first unit tests)
- Three Bells on the centre line with a line bet of 10 → 40 × 10 = 400.
- One cherry on reel 1 with a non-cherry on reel 2, line bet 10 → 1 × 10 = 10.
- Two cherries on reels 1 and 2, line bet 10 → 3 × 10 = 30.
- Three cherries → 12 × 10 = 120, not 1 + 3 + 12; a line pays its best single combination.
9. Definition of done
Tracked against the 16-point checklist in the Adding a Game section in this guide.
Cluster Pays 7×7Slots · slot_cluster7+
Family: Slots · Complexity: L · Phase 3 · Target RTP band: 95.5 – 96.5 %
Written before any code, per the Adding a Game section in this guide step 1.
1. Layout
A 7×7 grid — 49 cells. There are no reels and no paylines. Every cell is drawn independently from a weighted symbol pool.
That independence is what makes this game unenumerable: with six symbols across 49 cells the state space is 6⁴⁹, so unlike the reel slots there is no full cycle to walk. Its return is measured by simulation, and the figure is quoted with its standard error.
2. Symbols
| Id | Symbol | Pool weight |
|---|---|---|
| 0 | Nine | 20 |
| 1 | Jack | 18 |
| 2 | Lemon | 16 |
| 3 | King | 14 |
| 4 | Bell | 12 |
| 5 | Ruby | 9 |
| 6 | Crown | 5 |
| 7 | Wild | 2 |
No scatter. The feature is the multiplier ladder (§4), not a separate bonus round.
Seven paying symbols, not five — and the cast size is a maths decision, not a cosmetic one. On a 49-cell grid the chance of a five-plus connected group depends steeply on how common each symbol is. A first attempt with five paying symbols put the most frequent one at p ≈ 0.30, close enough to the square lattice's site-percolation threshold (≈ 0.593 for infinite grids, but reached far earlier for "does a group of five exist" on a small one) that large clusters formed on nearly every grid: the game returned 781 %. Widening the cast to seven brings the top symbol to p ≈ 0.21 and cuts the return by a factor of 12.7 on its own.
3. Clusters
A win is 5 or more identical symbols connected orthogonally — up, down, left and right. Diagonals do not connect. That convention is near-universal and getting it wrong by treating the grid as eight-connected roughly doubles the return, so there is a test for it.
Wilds join any cluster they touch, but a group of wilds alone is not a cluster: a wild takes the identity of the cluster it joins, so it can never seed one.
Payouts are multiples of the total bet (there are no lines to divide by), banded by cluster size:
| Symbol | 5–6 | 7–9 | 10–14 | 15+ |
|---|---|---|---|---|
| Nine | 0.2 | 0.8 | 3 | 15 |
| Jack | 0.3 | 1.2 | 5 | 25 |
| King | 0.5 | 2 | 8 | 40 |
| Ruby | 1 | 4 | 16 | 90 |
| Crown | 2 | 10 | 40 | 250 |
Values are held as hundredths internally, because money is integral and a 0.2× payout on a small stake must not silently round to nothing.
4. Tumbles and the multiplier ladder
After every win the winning symbols are removed, everything above them falls down, and new symbols drop in from the top. If the new arrangement contains clusters, it happens again.
Each successive tumble in the same spin raises the win multiplier:
| Tumble | 1st | 2nd | 3rd | 4th | 5th | 6th+ |
|---|---|---|---|---|---|---|
| Multiplier | ×1 | ×2 | ×3 | ×5 | ×10 | ×15 |
The ladder is the feature. A long chain is what pays, and it is what the presentation should build tension around.
5. Why the return is measured, not computed
Reel slots have a finite cycle. This one does not: the grid is 49 independent draws, and tumbles make the outcome a chain whose length is unbounded. So the return comes from simulation, reported with its standard error, exactly as for the Hold & Win feature (the Testing section in this guide §4).
A MaxTumbles cap exists so a mistuned pool cannot produce an endless chain. If it is ever actually reached, the configuration is wrong.
Achieved figures with the shipped configuration
| Total RTP (v1.1, gem meter running) | 96.20 % ± 0.24 pp (95 % interval 95.73 – 96.67 %, over 1,000,000 spins) |
| Cluster game alone (meter off) | 91.32 % ± 0.22 pp |
| Gem meter contribution | 4.88 pp |
| Hit frequency | 25.82 % |
| Standard deviation | 2.39 × stake |
| Max win observed | 227.6 × stake |
| 47.0 % of spins return nothing |
How it was tuned, and what that says about cluster slots
Two measurements, in this order:
- Widen the symbol cast — five paying symbols to seven. This alone took the return from
- Scale the paytable by the measured shortfall, 96 ÷ 61.65 = 1.557, landing at 96.11 %.
781 % to 61.65 %, a factor of 12.7, without touching a single payout. Cluster frequency is governed by symbol density, and it responds far more sharply than intuition suggests.
The lesson worth carrying to the remaining slots: in a cluster game the pool composition is the dominant lever and the paytable is the fine adjustment. Reaching for the paytable first would have meant dividing every value by eight and ending up with a game whose smallest win was unreadably small, rather than fixing the actual problem.
6. Sources consulted
- Cluster-pays slot conventions: a square grid with no paylines, wins as orthogonally
- Cascading / tumbling reel mechanics as used across modern video slots — winning symbols
connected groups of a minimum size, symbol removal with gravity refill, and an escalating multiplier across successive cascades in one spin. Confirms the mechanic, the four-neighbour connection rule and the minimum cluster size of five.
removed, remaining symbols fall, new symbols fill from above, repeat until no win. Confirms the refill model used here.
7. Deliberate deviations
- The symbol-collection meter shipped in v1.1 (§9), retuned together with the paytable
- No free-spin round. Same reasoning.
- A flat symbol pool. Some cluster slots bias the pool by position or by tumble depth. This one
exactly as the deferral note said it would have to be.
does not, which keeps the maths legible.
8. Worked examples (become the first unit tests)
- A cluster of five Nines on a 1,000 total bet pays 0.2 × 1,000 = 200.
- Four connected Nines pay nothing — five is the minimum.
- Two Nines touching only at a corner are two separate groups, not one cluster.
- A wild adjacent to four Nines makes a cluster of five and pays.
- A group of wilds alone pays nothing.
- A second tumble doubles whatever that tumble's clusters pay.
9. v1.1 addendum - the gem-collection meter
Sources (2): the collection-meter convention across commercial cluster/grid slots (a persistent counter fed by a designated symbol leaving the board, paying a bonus when full and rolling its surplus over), and the pick-bonus convention (the "choice" a machine offers is a weighted draw; ours is one honestly).
Mechanics. Every Ruby removed as part of a winning cluster adds one gem to the meter - wilds that joined a ruby cluster do not count, since they carry the wild symbol. The meter holds 15 gems, persists across spins for the session (like a card game''s shoe; Configure wipes it), and pays out after the spin''s chain settles: each full load awards a weighted pick of x5 / x10 / x25 the total bet at weights 60/30/10 - an expected 8.5x - and the surplus rolls over, so a monster ruby cluster can fill it more than once in one spin.
The retune. Measured over 1,000,000 spins, 0.086 rubies leave the board per spin, so the meter adds 4.88 pp of return. The paytable cedes exactly that: every value is the v1.0 value x 0.9485 (the same scale-the-paytable method (§5) that tuned the game originally), leaving the cluster game at 91.32 % and the total at 96.20 % +/- 0.24 - mid-band. The first attempt used a 40-gem meter, which measured +1.50 pp but filled only every ~570 spins: honest, and invisible. 15 gems fills roughly every 175 spins, which is a feature a player actually meets.
Session note. The meter resets with the scene, like the baccarat road maps. A replayed seed reproduces a round''s grids exactly, but the meter''s progress belongs to the session, not the round - the same caveat the card games'' shoes already carry.
10. Definition of done
Tracked against the 16-point checklist in the Adding a Game section in this guide.
Hold & Win RespinSlots · slot_holdwin+
Family: Slots · Complexity: L · Phase 3 · Target RTP band: 94.5 – 95.5 %
Written before any code, per the Adding a Game section in this guide step 1.
1. Layout
Five reels, three visible rows, 10 fixed paylines. Base-game strips are 20 positions, so the base game is a cycle of 20⁵ = 3,200,000 outcomes and its return is computed exactly.
The feature is not enumerable, and that is the point of this game — see §5.
2. Symbols
| Id | Symbol | Role |
|---|---|---|
| 0 | Nine | low |
| 1 | Jack | low |
| 2 | King | mid |
| 3 | Ruby | high |
| 4 | Crown | top |
| 5 | Wild | substitutes for everything except Coin, reels 2–4 only |
| 6 | Coin | carries a cash value and triggers the feature |
One Coin per strip on every reel, so at most one Coin is visible per reel and the trigger is "Coins on four or more of the five reels".
3. Base line wins
Left to right from reel 1, wild substitution, highest single combination per line, lines summed — identical to the other slots because it uses the same shared evaluator. Coins never form line wins; they only carry their cash value.
4. The Hold & Win feature
Landing Coins on 4 or more reels triggers it. Then:
- Every Coin on the grid locks in place and keeps its cash value.
- The player gets 3 respins.
- On each respin, every unlocked cell independently has a chance to become a new Coin.
- Any new Coin resets the respin counter to 3.
- The feature ends when the respins run out, or when all 15 cells hold Coins.
- The payout is the sum of every Coin's value, plus the Grand if the grid filled.
Each Coin's value is drawn from a weighted table when it lands:
| Value | Weight |
|---|---|
| 1 × total bet | 40 |
| 2 × | 25 |
| 3 × | 15 |
| 5 × | 10 |
| 10 × | 6 |
| Mini — 15 × | 3 |
| Minor — 50 × | 1 |
| Major — 200 × | 1 |
Filling all fifteen positions additionally awards the Grand, 1000 × total bet.
5. Why this feature cannot be enumerated
The other slots resolve in one shot, so every outcome can be walked. This one is a branching process: a respin can add coins, which resets the counter, which allows more respins, which can add more coins. The number of reachable states is unbounded — there is no full cycle to enumerate.
So the return is computed in two parts:
RTP = baseGameRtp (exact, by enumeration)
+ P(trigger) (exact, from the strips)
× E[feature payout] (measured, by simulating the feature alone)
Simulating only the feature, rather than the whole game, is what makes this tractable: the feature is entered directly a few million times instead of waiting roughly 450 base spins for each one. The same measurement would otherwise need billions of spins to be worth anything.
The retrigger dynamics deserve care. With 11 unlocked cells and a per-cell coin chance q, the expected new coins per respin is 11q, and because any new coin resets the counter the feature length is a random walk that can run long. MaxRespins is a hard cap so a mistuned q cannot produce an unbounded round — and if the cap is ever actually reached, the configuration is wrong, not the game.
Achieved figures with the shipped configuration
| Total RTP | 94.88 % ± 0.54 pp (95 % interval 93.83 – 95.93 %, over 3,000,000 spins) |
| Base game | 77.41 % exact, by enumerating all 3,200,000 stop combinations |
| Feature | 17.47 % measured |
| Trigger rate | 1 in 423 spins (predicted 1 in 449 from the strips) |
| Base hit frequency | 52.20 % |
| Whole-game hit frequency | 20.05 % |
| Standard deviation | 9.29 × stake |
| Max win observed | 1,427 × stake |
The standard error is quoted because it is genuinely large here: the feature fires about once in 420 spins and pays a long-tailed amount, so even three million spins leaves half a percentage point of uncertainty. Quoting "94.88 %" alone would imply a precision the data does not support.
RespinCoinChance is the dominant lever, and its effect is superlinear. Moving it from 0.055 to 0.085 took the feature from 9.75 % to 17.47 % — nearly double, for a change of three percentage points in a per-cell probability. More coins land, which resets the counter, which buys more respins, which land more coins. Anyone retuning this game should change that number in small steps and re-measure.
Volatility next to the other slots
| RTP | Hit frequency | Max win | SD | |
|---|---|---|---|---|
slot_video5x3 | 95.81 % | 74 % | 109 × | low |
slot_classic3 | 95.41 % | 31 % | 289 × | medium |
slot_holdwin | 94.88 % | 20 % | 1,427 × | 9.29 × stake |
Three slots within 0.7 percentage points of each other that feel nothing alike. Nearly half of all spins here return zero and one in five returns anything at all — which is precisely the shape a hold-and-win format is supposed to have.
6. Sources consulted
- Virtual reel strip / full-cycle par-sheet methodology for the base game, as used by the
- The Hold & Win / Link & Win respin format as it appears commercially: cash-value symbols
other slots in this kit.
that lock, a respin counter that resets on each new symbol, fixed jackpot tiers awarded as symbol values, and a Grand for filling the grid. Confirms the mechanic, the counter-reset rule and the jackpot structure.
7. Deliberate deviations
- No separate jackpot wheel. Some versions award the Major and Grand through a second bonus
- Jackpots are fixed multiples, not progressives. A progressive needs a meter that persists
- Coin values are drawn independently per coin. Some versions weight later coins differently.
screen. Here they are coin values and a full-grid award, which keeps the whole feature in one place.
across sessions and players; the meter belongs in the meta layer, not in a rules core.
8. Worked examples (become the first unit tests)
- Trigger. Coins on reels 1, 2, 3 and 5 → the feature starts with 4 locked coins and 3 respins.
- Counter reset. With 2 respins left, a respin that lands one new coin puts it back to 3.
- No new coin. A respin that lands nothing decrements: 3 → 2 → 1 → 0, then the feature ends.
- Payout. Four coins worth 1×, 2×, 5× and 50× the total bet, on a 100 bet → 5,800.
- Full grid. Fifteen coins also awards the Grand, 1000 × total bet.
9. Definition of done
Tracked against the 16-point checklist in the Adding a Game section in this guide.
Video Slot 5×3Slots · slot_video5x3+
Family: Slots · Complexity: L · Phase 2 (vertical slice) · Target RTP band: 95.0 – 96.0 %
Written before any code, per the Adding a Game section in this guide step 1.
1. Layout
Five reels, three visible rows, 20 fixed paylines. Each reel is a virtual reel strip of 20 positions. A spin picks one stop per reel independently and uniformly; the visible window is strip[stop], strip[stop+1], strip[stop+2], wrapping around the end of the strip exactly as a physical reel does.
The whole game is therefore a finite cycle of 20⁵ = 3,200,000 equally likely outcomes, which means its RTP can be computed exactly by enumeration rather than estimated by simulation. That is the reason for the 20-position strips: longer strips give finer probability control but put an exact full-cycle calculation out of reach, and for the kit's flagship slot a provable number is worth more than a finer one.
2. Symbols
| Id | Symbol | Role |
|---|---|---|
| 0 | Nine | low |
| 1 | Ten | low |
| 2 | Jack | low |
| 3 | Queen | low |
| 4 | King | mid |
| 5 | Ace | mid |
| 6 | Ruby | high |
| 7 | Crown | top |
| 8 | Wild | substitutes for everything except Scatter |
| 9 | Scatter | pays and triggers regardless of position |
Wilds appear on reels 2, 3 and 4 only. Scatters appear on reels 1, 3 and 5 only. Both are standard commercial designs and both matter to the math: restricting wilds to the middle three reels keeps five-of-a-kind wild wins rare, and restricting scatters to the odd reels makes the free-spin trigger exactly "one scatter on each of reels 1, 3 and 5".
3. Line wins
Evaluated left to right, starting at reel 1. A line pays the highest single combination on it; lines are summed. A win is paytable[symbol][count] × line bet.
Wild substitution has a subtlety that is easy to get wrong. When a line starts with wilds, the wilds can either pay as their own (high-paying) symbol, or substitute for the symbol that follows. A real machine pays whichever is worth more. An implementation that only substitutes quietly underpays the player and reports a lower RTP than it actually has. PaylineEvaluator evaluates both interpretations and keeps the better one, and there is a test for exactly this.
Scatters never form line wins.
4. Scatter and free spins
Scatters pay on count anywhere on the grid, multiplied by the total bet rather than the line bet — because a scatter win is not tied to a line.
Landing scatters on all three of reels 1, 3 and 5 pays 2 × total bet and awards 10 free spins.
During free spins:
- every win is multiplied by ×2;
- a genuinely distinct free-spin strip set is used (v1.1): the low symbols are thinned,
- landing all three scatters again retriggers, adding another award.
Rubies go from three to four per reel, Crowns from one to two, and the middle reel carries two wilds. Scatter counts are identical to the base set on every reel, so the trigger and retrigger probabilities carry over unchanged and all of the extra value flows through the paytable. A free spin on these strips returns 271.4 % of the bet against the base game's 86.3 % — the feature finally feels like a feature;
The award is back to the classic 10 free spins (v1.0 shipped 15): on the richer strips, ten spins are worth more than fifteen of the old identical-strip spins, and fifteen of them would blow through the top of the RTP band.
Retriggers make the expected number of free spins a converging series rather than a flat 10:
E[spins] = 10 / (1 − 10q) where q = P(retrigger on one free spin)
The RTP calculator evaluates this closed form rather than simulating it.
5. Gamble
Any line win may be gambled through the shared cas_coinflip core (double or nothing, capped by that game's MaxStreak). Because the gamble returns exactly 99 % of what is risked per flip, it lowers the slot's effective RTP for players who use it. It is therefore excluded from the headline figure and documented separately, which is how real machines report it.
6. How the RTP is computed
RTP = baseGameRtp + P(trigger) × E[spins] × freeSpinRtpPerSpin
baseGameRtp— exact, by enumerating all 3,200,000 base-strip stop combinations and summingfreeSpinRtpPerSpin— exact, by the same enumeration over the free-spin strips with the ×2P(trigger)andq— exact, from the per-reel scatter counts.
line wins plus scatter pays, divided by the total bet staked across the cycle.
multiplier applied.
No simulation is involved anywhere, so the number is a fact about the configuration rather than an estimate with error bars. The editor tool shows it live as the designer edits a strip or a paytable cell.
Achieved figures with the shipped configuration (v1.1, distinct free-spin strips)
| Total RTP | 95.8112 % (house edge 4.1888 %) |
| Base game | 86.3332 % |
| Free-spin feature | 9.4779 % |
| Cycle size | 3,200,000 combinations |
| Trigger rate | 1 in 296 spins |
| Expected free spins per trigger | 10.35 (10 awarded, extended by retriggers) |
| Free spin value | 271.4 % of the base bet (was 172.67 % on the identical strips) |
| Base hit frequency | 74.49 % |
| Base max win | 109 × total bet |
| RTP by symbol (base) | Nine 20.85 %, Jack 20.64 %, King 21.19 %, Ruby 19.82 %, Crown 3.15 %, Scatter 0.68 % |
The free-spin reel compositions, per 20-position strip (base in parentheses): reels 1 and 5 carry N×5 (6), J×4 (5), K×4 (4), R×4 (3), C×2 (1), S×1 (1); reels 2 and 4 the same with the scatter swapped for one wild; the middle reel N×3, J×4, K×4, R×4, C×2, S×1 and two wilds (one). The tuning walk is worth recording: the first candidate — two wilds on all three middle reels and three Crowns on the outer ones — blew the return to 100.99 %, a player-edge machine; pulling the extra wilds and a Crown swung it to 94.21 %, under the band; restoring a single extra wild on the middle reel alone landed 95.81 %. Wild count on the pay-path reels is by far the most powerful knob in the cabinet, moving nearly seven points of RTP across those three steps.
Tuning notes
- Hit frequency of 74 % is high for the base game. Commercial video slots usually sit in
- The 109 × maximum base win is low, but the feature now carries the volatility: five
the 25 – 45 % band; this one pays something on three spins in four, almost always less than the stake — a coherent "frequent small wins" style, flagged as a deliberate choice.
Crowns on the free-spin strips with the ×2 multiplier pays 3,200 × the line bet, and the distinct set is exactly where that volatility belongs.
7. Sources consulted
- Virtual reel strip methodology and full-cycle (par sheet) RTP calculation — the standard
- Commercial video slot conventions: 5×3 with fixed paylines, left-to-right evaluation from
approach in which a slot's return is the total paid across every combination of stop positions divided by the total wagered, as described in the Wizard of Odds' treatment of slot machine mathematics. Confirms both the strip model and the full-cycle definition of RTP used here.
reel 1, wilds restricted to the middle reels, scatters paying on count and multiplied by total bet, and free-spin rounds using an alternate strip set with a win multiplier. Confirms the feature structure and the scatter/line-bet distinction.
The two agree on the model. Typical commercial video slot RTP sits in the 94 – 96.5 % band, which is where the 95.0 – 96.0 % target for this game comes from; unlike blackjack or roulette there is no single published figure to match, because a slot's return is whatever its designer tunes it to.
8. Deliberate deviations
- A single 3-scatter award rather than a tiered 3/4/5 award. With scatters confined to reels 1,
- No "buy feature", which some markets prohibit outright. The config has the flag; it is off.
3 and 5 a fourth scatter is impossible, so a tiered table would advertise outcomes that can never occur. The tiered form is available by putting scatters on all five reels, which the editor tool supports and the calculator handles.
9. Worked examples (become the first unit tests)
Line win. Centre payline showing King, King, King, Nine, Ten with a line bet of 10: King pays 10× at three of a kind → 100 credits.
Wild substitution. Centre line Ruby, Wild, Ruby, Nine, Ten: the wild substitutes, giving three Rubies at 20× → 200 credits.
Leading wilds, best interpretation. Centre line Wild, Wild, Nine, Nine, Nine: as wilds that is two wilds, which pays nothing; as Nines it is five Nines at 50× → the machine must pay 500, not 0.
Scatter trigger. Scatters on reels 1, 3 and 5 with a total bet of 200: pays 2 × 200 = 400 and awards 10 free spins.
10. Definition of done
Tracked against the 16-point checklist in the Adding a Game section in this guide.
Ways Slot 6-Reel with CascadesSlots · slot_ways6+
Family: Slots · Complexity: XL · Phase 3 · Target RTP band: 96.5 – 97.5 % (see §6 — the band was set by measurement, not before it)
Written before any code, per the Adding a Game section in this guide step 1.
1. Layout
Six reels. Each reel shows a different number of symbols on every spin, from 2 to 7, drawn from a weighted height table. There are no paylines.
The number of ways to win is the product of the reel heights, so a spin where every reel shows seven offers 7⁶ = 117,649 ways. A spin of all twos offers 2⁶ = 64. That variability is the format's signature and it is why the reel heights are drawn before anything else happens.
2. Symbols
| Id | Symbol | Pool weight |
|---|---|---|
| 0 | Nine | 15 |
| 1 | Ten | 14 |
| 2 | Jack | 13 |
| 3 | Queen | 12 |
| 4 | King | 11 |
| 5 | Ace | 10 |
| 6 | Ruby | 8 |
| 7 | Emerald | 6 |
| 8 | Crown | 4 |
| 9 | Wild | 3 |
| 10 | Scatter | 2 |
Nine paying symbols, and the cast size is a maths decision. A run needs only three consecutive reels, and with reels averaging over four cells the chance a given symbol appears somewhere on a reel is high. With five paying symbols a three-reel run happened on most spins, cascades never terminated, and the game returned 6,665 % — see §6.
3. Ways wins
A symbol pays when it appears on consecutive reels starting at reel 1, on three or more reels. The win counts once per distinct path: the number of ways is the product of how many of that symbol appear on each contributing reel.
Wilds substitute for everything except the scatter and count towards a reel's tally. Each symbol pays at most once per spin, at its longest run.
Payouts are per way, in thousandths of the total bet:
| Symbol | 3 reels | 4 reels | 5 reels | 6 reels |
|---|---|---|---|---|
| Nine | 6 | 19 | 50 | 130 |
| Ten | 7 | 21 | 57 | 145 |
| Jack | 8 | 26 | 65 | 160 |
| Queen | 12 | 32 | 78 | 195 |
| King | 14 | 39 | 96 | 245 |
| Ace | 19 | 46 | 116 | 290 |
| Ruby | 26 | 71 | 180 | 450 |
| Emerald | 39 | 103 | 270 | 675 |
| Crown | 64 | 180 | 480 | 1,220 |
Per-way values are necessarily tiny: a six-reel Crown across tall reels can be thousands of ways, so a value that looks generous in isolation becomes enormous once multiplied. This is the single most counter-intuitive thing about tuning a ways game.
Thousandths, not hundredths. At hundredths the most common wins all rounded to the same value and the grading between the low symbols disappeared — the extra digit is doing real work.
4. Tumbles and the multiplier ladder
After a win the winning symbols are removed, the symbols above them fall, and new symbols drop in. If the new arrangement wins again, it happens again. Reel heights do not change during a tumble chain — the grid keeps its shape until the spin ends.
| Tumble | 1st | 2nd | 3rd | 4th | 5th+ |
|---|---|---|---|---|---|
| Multiplier | ×1 | ×2 | ×3 | ×5 | ×8 |
5. Free spins
Four or more scatters award 12 free spins. During them the multiplier ladder does not reset between spins — it keeps climbing for the whole round. That persistent multiplier is the defining feature of the format, and it is where most of the feature's value lives.
6. Why the return is measured, not computed
Reel heights are drawn per spin and every cell is an independent draw, so there is no finite cycle to enumerate — the same situation as the cluster slot. The return is measured and quoted with its standard error.
Achieved figures with the shipped configuration
| Total RTP | 97.07 % ± 0.34 pp (95 % interval 96.40 – 97.73 %, over 2,000,000 spins) |
| Hit frequency | 15.47 % |
| Standard deviation | 4.80 × stake |
| Max win observed | 537 × stake |
The declared band was 95.5 – 96.5 % and the game came out at 97.07 %. That figure was accepted rather than corrected, and the reasoning is worth recording: the standard error is 0.34 pp, so "correcting" a one-point gap would be adjusting a number by less than three times its own uncertainty — false precision. 97 % is squarely inside the range this format runs commercially, and one percentage point of return is not a difference a player can perceive. The band above has been updated to match measurement rather than the guess that preceded it.
If the return ever does need to move, the lever is the paytable, and it scales it linearly.
How it was tuned
Three measurements:
- First run: 6,665 % RTP, with tumble chains reaching 63 and hitting the safety cap. A run
- Widen the cast to nine paying symbols: 149.5 %. A factor of 44.6, without touching a single
- Scale the paytable, and move it from hundredths to thousandths of the bet: 97.07 %. The
needs only three consecutive reels, and with reels averaging over four cells the chance a symbol appears somewhere on a reel is high — so with five paying symbols a win happened on most cascades and the chain never terminated.
payout. The cap was no longer reached, because chains now end on their own.
extra digit was necessary, not cosmetic — at hundredths the most common wins all rounded to the same value and the grading between the low symbols vanished.
The same lesson as slot_cluster7, and now confirmed twice: in a cascading game the symbol pool is the dominant lever and the paytable is the fine adjustment. Both games were first tuned by reaching for the paytable in the design, and both needed the pool fixed instead.
7. Sources consulted
- The six-reel variable-height "ways" format as it appears commercially: reel heights drawn
- Cascading / tumbling reel mechanics as used across modern video slots, already applied by
per spin, ways as the product of those heights, wins as consecutive-reel runs from reel 1 counted once per path, cascading symbol removal, and a free-spin round whose win multiplier persists across spins rather than resetting. Confirms the layout, the ways calculation and the feature.
slot_cluster7 in this kit. Confirms the refill model.
8. Deliberate deviations
- Cells are drawn from a weighted pool, not from per-height reel strips. Commercial versions
- The feature buy shipped in v1.1 (see §11), config-gated off for the markets that
- A capped multiplier ladder in the base game. The ladder tops out at ×8 in the base game and
hold a separate strip per reel height. The pool model is simpler, is genuinely tunable, and does not change the shape of the game; it does mean the return must be measured rather than enumerated, which it would be anyway because of the cascades.
prohibit it.
persists (rather than growing without limit) during free spins.
9. Worked examples (become the first unit tests)
- Ways count. Reels showing 2, 3, 4, 5, 6, 7 symbols offer 2×3×4×5×6×7 = 5,040 ways.
- A three-reel run. Nine appearing twice on reel 1, once on reel 2 and three times on reel 3,
- A wild extends a run. A reel whose only match is a wild still contributes to the tally.
- Scatters never pay as ways, they only trigger the feature.
- A second tumble doubles whatever that tumble wins.
with none on reel 4, is 2 × 1 × 3 = 6 ways at the three-reel rate.
10. Definition of done
Tracked against the 16-point checklist in the Adding a Game section in this guide.
11. v1.1 addendum - the feature buy
Sources (2): the "bonus buy / feature buy" convention documented across commercial slot suppliers (a fixed price in whole bets enters the free-spin round directly, with the buy's RTP published alongside the game's), and the market-restriction practice (the UK among others prohibits buys, hence the config gate) as reported by gambling regulators' guidance.
Mechanics. WaysBets.FeatureBuy stakes price x bet on a slip of its own, skips the base spin entirely, and plays the standard free-spin round - 12 spins, the persistent multiplier ladder starting at the bottom, no retriggers, exactly as an organic trigger plays it. The slip is validated: the buy rides alone, the price must divide back into a whole-credit bet, and a configuration with the buy disabled refuses the wager outright.
Pricing, honestly. The free-spin round measures 32.60 x the bet (SE 0.08, 150,000 bought rounds). Whole-bet pricing therefore quantises the buy's return in ~2.9-point steps:
| Price | Buy RTP |
|---|---|
| 33 x | 98.79 % - above the game's own 97.07 %, which no operator prices |
| 34 x (shipped) | 95.89 % |
| 35 x | 93.14 % |
The shipped price is the nearest whole-bet price that stays below the game's own return. That lands the buy 0.6 points under the game's 96.5-97.5 band - recorded as the honest consequence of integer pricing rather than stretched to fit: the alternatives were a fractional price (nothing else in the kit prices in fractions of a bet) or quietly enriching the bought round until a rounder number worked (a different feature wearing the same name). The figure is pinned in the Heavy suite with its standard error, alongside an assertion that the buy can never return more than the game it buys into.
Bonus WheelTables · table_bonuswheel+
Family: Tables · Complexity: M · Phase 5 · Return: configurable by design
Written before any code, per the Adding a Game section in this guide step 1.
1. What this game is for
Unlike every other game in the kit, the bonus wheel has no published house edge to match. It is the generic prize wheel: the daily-bonus wheel, the level-up wheel, the "spin to win" wheel. Its return is whatever the designer configures, and the whole point of shipping it is that the designer can see what they configured before they ship it.
So the verification target here is not a percentage. It is that the tooling tells the truth.
2. The shipped rule set
| Rule | Shipped value |
|---|---|
| Segments | Any number, each with an independent weight and visual size |
| Shipped table cost | 25 credits for one complete chain; the rules core remains configurable |
| Prize types | Coins, jackpot, multiplier-respin, advance to the next tier, nothing |
| Tiers | A chain of wheels; landing on "advance" spins the next, richer one |
3. Weight and visual size are independent — and that is the point
A segment's weight decides how often it is chosen. Its visual size decides how much of the wheel it occupies. On a real Big Six wheel the two coincide; on a bonus wheel they usually must not.
A jackpot wedge drawn at 1/12th of the wheel but weighted at 1/500th is standard practice in this genre and is exactly what players expect from a bonus wheel. Drawing it at 1/500th would make it invisible and the wheel pointless.
The kit therefore keeps the two separate everywhere, and the editor shows weight % and visual % side by side so the gap is never accidental. What matters is that the pointer lands where the weights say — the animation must follow the visual layout while the outcome follows the weights, and the two must agree on which segment won.
4. Respins make the return a geometric series
A respin segment spins again. That makes the expected value self-referential:
EV = ( value contribution + advance contribution ) / ( 1 − Σ pᵢ·mᵢ )
where the sum runs over respin segments and mᵢ is the multiplier each carries (a plain respin carries 1). This is a closed form, not a simulation.
It diverges when Σ pᵢ·mᵢ ≥ 1. A wheel whose respin segments are weighted too heavily, or whose multipliers are too large, has an infinite expected value and will run forever. The kit refuses to compute such a wheel and says why, rather than returning a number that looks plausible.
Tiers resolve backwards: the last wheel has no advance segments, so its EV is direct, and each earlier tier substitutes the tier it advances to.
5. Sources consulted
- Evolution Crazy Time — central physical wheel, fixed flapper, multiplier-bearing bonus
- Pragmatic Play Sweet Bonanza CandyLand — event-sensitive light/sound and a free-respin
- IGT Wheel of Fortune — physical wheel/pointer as the visual centrepiece and jackpot
- the game catalog in this guide §20 and the shared
WheelEngine, which define and implement the
chains and visible result history: <https://games.evolution.com/live-casino/game-shows/crazy-time/>.
multiplier that visibly escalates the chain: <https://www.pragmaticplay.com/en/live-casino/sweet-bonanza-candyland/>.
anticipation: <https://www.igt.com/products-and-services/gaming/wheel-of-fortune>.
deliberate separation between outcome weight and visual wedge size.
There is no external house-edge target because this is a configurable prize tool. The shipped preset therefore discloses its fixed price, every exact segment chance and its configured awards.
6. Deliberate deviations
- No "nudge" or "hold" mechanics. Some bonus wheels let a player nudge the pointer; that is a
- Multiplier segments are modelled as multiplier-respins, not as a multiplier banked against a
- No cooldown or daily limit. Those belong to the meta layer, not the wheel.
different game and a different fairness conversation.
later win. Banking needs cross-round state; respinning keeps the closed form and covers the common case.
7. Achieved figures
There is no published edge to match here, so these are the claims about the tooling that the tests establish.
The geometric series is exact
| Wheel | Respin pressure | Exact EV | Exact spins |
|---|---|---|---|
| 100 / 200, no respin | 0.0000 | 150.00 | 1.000 |
| 100 or respin, half each | 0.5000 | 100.00 | 2.000 |
| 100 (¾) or 3× respin (¼) | 0.7500 | 300.00 | 1.333 |
| 100 (¾) or advance to a 1000 wheel (¼) | 0.0000 | 325.00 | 1.250 |
| Shipped reference wheel (x2 respin) | 0.1600 | 379.76 | 1.087 |
Each is asserted to twelve decimal places against its closed form. The half-respin wheel returning exactly double is the series made concrete: 50 / (1 − 0.5) = 100.
The 3× case separates two things that look alike: pressure is 0.25 × 3 = 0.75, which triples the value, while the spin count uses the plain respin probability of 0.25 — a 3× respin takes no longer than a 1× one.
A divergent wheel is refused, not computed
A wheel that is half 2×-respin has a pressure of exactly 1.0000 and a genuinely infinite expected value. Compute throws rather than returning a number:
*Tier 0 has a respin pressure of 1.0000. At 1.0 or above the wheel respins faster than it
resolves, so its expected value is infinite and a round would only ever end at the spin cap.*
Visual size is proved irrelevant to value, and to the outcome
Drawing the jackpot forty times larger changes the wheel's expected value by exactly zero, asserted to twelve decimals.
More importantly, the shipped wheel's jackpot is drawn as one wedge of seven — 14.29 % of the wheel — while weighted at 2 in 100. The heavy 400,000-spin regression requires the measured rate to remain near that weight and far below the visual share:
| Jackpot | |
|---|---|
| Visual share | 14.29 % |
| Weight | 2.00 % |
| Heavy regression tolerance | 2.00 % ± 0.40 pp |
It lands at its weight, nowhere near its size. A respin can carry a later jackpot into the same round, so the test deliberately allows a small excess over the raw first-spin chance.
The validator earns its place
Given a deliberately broken wheel it reported all four faults:
- a segment with zero weight — drawn on the wheel and unable to win;
- a segment occupying 94.3 % of the wheel while winning 1.00 % of the time, 94× its share;
- a respin pressure of 1.8000, so every round runs to the cap;
- an Advance segment on the last tier, with nowhere to advance to.
The rules core matches the closed form
The reference wheel's closed form is 319 / (1 − 0.16) = 379.7619 credits, with 1.0870 expected physical spins. The heavy Monte Carlo regression compares both the rules core and spin count against those exact figures; the award tolerance is wider because of the 10,000-credit jackpot, while the spin count remains the sharper check.
8. Worked examples (become the first unit tests)
- A wheel with no respins has an EV equal to the plain weighted sum.
- A wheel that is half respin has exactly double the EV of the same wheel without it.
- A wheel weighted to respin too often is refused, not computed.
- Visual size does not change the EV at all — only weight does.
- A jackpot drawn at 1/12 and weighted at 1/500 lands 1 time in 500, not 1 in 12.
- A two-tier wheel's EV includes the second tier's, discounted by the chance of reaching it.
9. Definition of done
Tracked against the 16-point checklist in the Adding a Game section in this guide.
CrapsTables · table_craps+
Family: Tables · Complexity: L · Phase 5 · Reference house edge: 1.41 % pass line · 1.36 % don't pass
Written before any code, per the Adding a Game section in this guide step 1.
1. The shipped rule set
| Rule | Shipped value |
|---|---|
| Dice | Two, six-sided, fair |
| Come-out roll | 7 or 11 wins the pass line; 2, 3 or 12 loses it |
| Point | 4, 5, 6, 8, 9 or 10 becomes the point |
| Point phase | The point wins; a 7 ("seven out") loses and ends the round |
| Don't pass | Reversed, except 12 is a push ("bar 12") |
| Odds | Free odds behind the line, paid at true odds |
Craps is the only game in the kit whose round spans an unbounded number of rolls. A casino table normally accepts additional legal bets between throws; this kit's deliberately simpler committed- layout mode is recorded in §5 rather than pretending to be a full live-dealer workflow.
2. The bets
Line bets
| Bet | Wins | Loses | Edge |
|---|---|---|---|
| Pass line | 7, 11 on the come-out; then the point | 2, 3, 12 on the come-out; then a 7 | 1.41 % |
| Don't pass | 2, 3 on the come-out; then a 7 | 7, 11 on the come-out; then the point | 1.36 % |
| Come / Don't come | As above, from the next roll | as above |
"Bar 12" is what makes don't pass work. Without it the don't-pass bettor would have an edge, so a come-out 12 pushes instead of winning. It is the single rule the whole dark side depends on.
Free odds — the only fair bet in the casino
Backing a point with odds pays true odds and carries zero house edge:
| Point | Pass odds pay | Don't pass odds lay |
|---|---|---|
| 4 or 10 | 2:1 | 1:2 |
| 5 or 9 | 3:2 | 2:3 |
| 6 or 8 | 6:5 | 5:6 |
No other wager anywhere in this kit returns exactly 100 %. It is the reason craps is quoted with a "combined" edge that falls as the odds multiple rises.
Place bets
| Number | Pays | Edge |
|---|---|---|
| 4 or 10 | 9:5 | 6.67 % |
| 5 or 9 | 7:5 | 4.00 % |
| 6 or 8 | 7:6 | 1.52 % |
One-roll and multi-roll propositions
| Bet | Pays | Edge |
|---|---|---|
| Field (2 pays 2:1, 12 pays 3:1) | varies | 2.78 % |
| Big 6 / Big 8 | 1:1 | 9.09 % |
| Hard 6 / Hard 8 | 9:1 | 9.09 % |
| Hard 4 / Hard 10 | 7:1 | 11.11 % |
| Any craps (2, 3, 12) | 7:1 | 11.11 % |
| 3 or 11 | 15:1 | 11.11 % |
| 2 or 12 | 30:1 | 13.89 % |
| Any seven | 4:1 | 16.67 % |
Any seven is the worst bet on the table and sits in the middle of it. The help screen says so.
Big 6 and Big 8 pay even money for exactly the same event as a place bet on 6 or 8, which pays 7:6 — 9.09 % against 1.52 %. Two bets, one event, six times the edge. That comparison is worth showing a player directly.
3. Every figure here is exact
Two dice have 36 outcomes. Single-roll bets sum over them directly. Multi-roll bets — the line, place bets, hardways — reduce to "A before B", whose probability is ways(A) / (ways(A) + ways(B)), with no series to sum and no simulation needed.
The pass line works out to 244/495 exactly:
8/36 + 2 × [ (3/36)(3/9) + (4/36)(4/10) + (5/36)(5/11) ] = 244/495 = 0.4929292…
giving an edge of 1.4141 %. That derivation is already asserted in the rules kernel's own tests and is re-derived here from the shipped bet definitions, so the game and the kernel have to agree.
4. Sources consulted
- The Wizard of Odds' craps analysis — the 1.41 % and 1.36 % line edges, the zero-edge free
- Published casino craps rule sheets — the come-out/point structure, bar-12 on don't pass,
odds, the place and proposition edges in §2, and the 2.78 % field figure for a 3:1 twelve. Confirms every figure this game is verified against.
true-odds payouts, and that place bets are off on the come-out unless the player says otherwise.
5. Deliberate deviations
- Field pays 3:1 on twelve. Both 2:1 and 3:1 variants exist; 3:1 gives 2.78 % and 2:1 gives
- Buy and lay bets are not shipped. They need a commission model with its own rounding rules;
- No fire bet, no all/tall/small. Side bets with their own paytables and their own state.
- Place bets are off on the come-out by default, which is the standard rule.
- The layout locks when the come-out throw starts. Later rolls can be thrown manually or left
5.56 %. Both are configurable and the shipped default is the better one, stated plainly.
place bets cover the same numbers.
to auto-roll, but bets cannot be added, removed or turned on/off mid-hand. Odds placed before a point are refunded if the come-out decides the line. This keeps a whole shooter hand atomic for wallet settlement, replay seeds and interruption recovery; it is an explicit Easy-Mode limitation compared with a full live Craps table.
6. Achieved figures — exact, every one
| Bet | P(win) | Return | Edge |
|---|---|---|---|
| Pass line | 0.492929 | 98.5859 % | 1.4141 % |
| Don't pass | 0.479293 | 98.6364 % | 1.3636 % |
| Free odds, all six points | — | 100.0000 % | 0.0000 % |
| Place 6 / 8 | 0.454545 | 98.4848 % | 1.5152 % |
| Place 5 / 9 | 0.400000 | 96.0000 % | 4.0000 % |
| Place 4 / 10 | 0.333333 | 93.3333 % | 6.6667 % |
| Field (12 pays 3:1) | 0.444444 | 97.2222 % | 2.7778 % |
| Hard 6 / 8 | 0.090909 | 90.9091 % | 9.0909 % |
| Big 6 / 8 | 0.454545 | 90.9091 % | 9.0909 % |
| Any craps | 0.111111 | 88.8889 % | 11.1111 % |
| Hard 4 / 10 | 0.111111 | 88.8889 % | 11.1111 % |
| Horn 3 / 11 | 0.055556 | 88.8889 % | 11.1111 % |
| Horn 2 / 12 | 0.027778 | 86.1111 % | 13.8889 % |
| Any seven | 0.166667 | 83.3333 % | 16.6667 % |
Every figure matches its published value. The pass line lands on 244/495 to twelve decimal places, and free odds return exactly 100 % on all six points — the only fair wager anywhere in this kit.
Three claims the tests make that a percentage alone would not
Bar-12 is load-bearing. The don't-pass line wins 47.93 % of the time and pushes 2.78 %. The test computes what it would return without the bar and asserts the result is a player edge — so the rule is shown to be the only thing keeping the bet on the house's side, not merely present.
Big 6 and place-6 win on exactly the same event. The test asserts their win probabilities are identical to twelve decimal places — both 5/11 — and that Big 6 still costs six times as much, purely because it pays even money instead of 7:6. Two bets, one event, 9.09 % against 1.52 %.
Any seven is the worst bet on the table. Rather than checking 16.67 %, the test scans every shipped bet and asserts that this one has the highest edge of all of them.
The rules core is checked against the closed form
The multi-roll engine and the arithmetic must agree, so 400,000 rounds are played through the actual rules core: measured pass-line rate 0.492975 against the exact 0.492929, and an average of 3.373 rolls per round. The roll count is the sharper of the two — a come-out or point bug can leave the win rate looking plausible while the round length goes badly wrong.
7. Worked examples (become the first unit tests)
- The pass line wins exactly 244 times in 495.
- A come-out 12 pushes the don't pass line — it does not win.
- Free odds return exactly 100 % on all three point pairs.
- A place bet on 6 pays 7:6, so 60 returns 130 including the stake.
- Big 6 and place-6 win on the same event and pay 9.09 % and 1.52 % respectively.
- Hard 8 loses to an easy 8 (6-2, 5-3) as well as to a 7.
- Any seven pays 4:1 and returns 83.33 %.
8. Definition of done
Tracked against the 16-point checklist in the Adding a Game section in this guide.
9. v1.2 physical shooter and feedback addendum
The committed outcome is now replayed as an interactive physical sequence rather than two pipped squares changing in place. Both authored dice enter through a visible shooter lane, travel, bounce, rotate and settle on the rules engine's exact faces. After a point is established the primary action becomes ROLL AGAIN for a short manual-throw window; inactivity continues through a configurable auto-roll delay, while an active tumble truthfully exposes SKIP. Skip and natural completion produce the same faces, result and wallet settlement.
An authored puck moves to 4, 5, 6, 8, 9 or 10 and reads ON, then flips to HIT or OFF on the resolving throw. Six recent totals remain in session order. Every one of the 23 shipped wager spots has an authored resolution frame, while the result panel names total gross return and exact net. Before commitment the HUD shows live bet count, total stake and the maximum compatible gross return available on the next pair of dice, computed by enumerating all 36 ordered outcomes.
Layout convenience is separate from stake denomination: UNDO removes the last tap and REBET restores the exact last accepted 23-spot layout. The dice landing triggers a short mechanic-specific felt/back-wall impact; no ambience or looping source is introduced.
Money Wheel (Big Six)Tables · table_moneywheel+
Family: Tables · Complexity: S · Phase 5 · Reference house edge: 11.11 % to 24.07 %
Written before any code, per the Adding a Game section in this guide step 1.
1. The shipped rule set
| Rule | Shipped value |
|---|---|
| Wheel | 54 segments, standard Big Six layout |
| Round | One spin resolves every bet |
| Bets | One per symbol; any number may be backed at once |
The simplest game in the kit — no decisions, no state, one spin. It is also the worst value on any casino floor, and the help screen says so plainly rather than hiding it.
2. The layout and its edges
| Symbol | Segments | Pays | Return | Edge |
|---|---|---|---|---|
| $1 | 24 | 1:1 | 88.89 % | 11.11 % |
| $2 | 15 | 2:1 | 83.33 % | 16.67 % |
| $5 | 7 | 5:1 | 77.78 % | 22.22 % |
| $10 | 4 | 10:1 | 81.48 % | 18.52 % |
| $20 | 2 | 20:1 | 77.78 % | 22.22 % |
| Joker | 1 | 40:1 | 75.93 % | 24.07 % |
| Logo | 1 | 40:1 | 75.93 % | 24.07 % |
24 + 15 + 7 + 4 + 2 + 1 + 1 = 54.
The edges do not rise monotonically with the payout. $10 pays more than $5 and costs less — 18.52 % against 22.22 %. That is not a subtlety worth burying: the best bet on the wheel is the one that pays least, and the second best is $10, not $5. Anyone reskinning this game needs to know the payouts and the segment counts are not in a simple relationship.
3. Weights and visual size are different things
The kit's WeightedSegmentTable keeps a segment's weight (how often it is chosen) separate from its visual size (how much of the wheel it occupies). For a real Big Six wheel the two coincide — every segment is the same width, so a symbol's share of the wheel is its probability.
Ship them equal, but keep them separate: a wheel whose $20 wedge is drawn twice as wide as its odds justify is a rigged wheel, and the distinction is what makes that impossible to do by accident.
4. This game is fully enumerable
Fifty-four segments. Every figure in this document is a division. Like roulette, it is the right place to assert structural facts — that the segments sum to 54, that no two symbols share a count they should not — rather than only that seven percentages match a source.
5. Sources consulted
- The Wizard of Odds' Big Six analysis — the 54-segment layout with its 24/15/7/4/2/1/1 split,
- Published casino Big Six layouts — the same segment counts, and that the two 40:1 symbols
the payout odds, and the 11.11 % to 24.07 % edge range including the $10 anomaly. Confirms every figure this game is verified against.
(joker and house logo) each occupy exactly one segment.
6. Deliberate deviations
- No "wheel of fortune" bonus round. Some machines add one; it is a different game.
- The joker and logo pay 40:1, not 45:1 or 50:1. Both variants exist; 40:1 is the common one
and is what the published edge assumes. The paytable is data and can be retabled.
7. Achieved figures — exact
| Symbol | Segments | Pays | Return | Edge |
|---|---|---|---|---|
| $1 | 24 | 1:1 | 88.8889 % | 11.1111 % |
| $2 | 15 | 2:1 | 83.3333 % | 16.6667 % |
| $10 | 4 | 10:1 | 81.4815 % | 18.5185 % |
| $5 | 7 | 5:1 | 77.7778 % | 22.2222 % |
| $20 | 2 | 20:1 | 77.7778 % | 22.2222 % |
| Joker | 1 | 40:1 | 75.9259 % | 24.0741 % |
| Logo | 1 | 40:1 | 75.9259 % | 24.0741 % |
Every figure matches its published value. Note the ordering: the table is sorted by edge, and the payouts are not in order. $10 pays twice what $5 pays and costs four points less.
What the tests assert beyond seven percentages
$10 is proved cheaper than $5. The test asserts that $10's odds are higher and its edge is lower — the relationship a reskinner would otherwise assume runs the other way.
$5 and $20 are proved identical. 7 × 6 = 42 and 2 × 21 = 42, so both return 42/54 exactly. The test asserts equality to twelve decimal places rather than checking 22.22 % twice.
$1 is proved best and the 40:1 pair worst, by scanning all seven rather than checking two numbers.
Every bet is proved to lose. The test asserts all seven edges exceed 10 % — there is no good bet on this wheel, and covering the entire wheel with all seven bets at once measures 19.77 % over 200,000 spins. Covering the wheel never helps, and here it is shown rather than claimed.
Weight and visual size are proved to agree. Every symbol occupies exactly the share of the wheel its odds imply, asserted to twelve decimal places. The two remain separate fields precisely so that a wheel drawn with a wider $20 wedge than its probability justifies — a rigged wheel — cannot happen by accident. The pointer's landing position is separately asserted to fall inside the winning segment over 500 spins.
The rules core is checked against the layout
540,000 spins: every symbol within 5 % of its segment count, from 239,934 ones against an expected 240,000 down to 9,938 jokers against 10,000.
8. Worked examples (become the first unit tests)
- The segments sum to exactly 54.
- $1 covers 24 segments and returns 88.89 % — the best bet on the wheel.
- $10 costs less than $5 despite paying twice as much.
- The joker and the logo have identical edges and one segment each.
- A $5 win on 100 returns 600, being the stake plus 5:1.
- Backing every symbol at once still loses, because every individual bet does.
9. Definition of done
Tracked against the 16-point checklist in the Adding a Game section in this guide.
10. Physical presentation contract
- The mathematical seven-symbol table and the drawn rotor are intentionally separate views of
- The physical sequence must contain exactly 24/15/7/4/2/1/1 copies, never more than two equal
- Every stop is visibly marked and colour-coded. A settled result must be attributable to the
- The flapper produces discrete, decelerating pin feedback and settles without a teleport. Natural,
- The live HUD always exposes number of bets, total stake, best possible gross return and five-spin
- Rebet restores the exact previous seven-position layout; Undo removes the latest chip placement.
- No wheel sound may be an ambient/buzzing loop: start, pin, settle and result cues are finite,
the same data. BuildTable() aggregates counts for exact edge reporting; BuildPhysicalTable() expands them into 54 equal-width individual stops for rules selection and pointer placement.
adjacent stops, and the pointer fraction must lie inside the exact selected stop.
flapper without trusting a detached text label.
skipped, turbo and reduced-motion paths must preserve the same final stop and wallet result.
history. The final message always includes landed symbol, exact total return and signed net.
Winning layout positions glow green, committed losers red, and authored chips clear through the shared settlement sweep.
mechanic-aligned one-shots.
RouletteTables · table_roulette+
Family: Tables · Complexity: M · Phase 5 · Reference house edge: 2.70 % (single zero) · 5.26 % (double zero)
Written before any code, per the Adding a Game section in this guide step 1.
1. The shipped rule set
| Rule | Shipped value |
|---|---|
| Default wheel | European, single zero — 37 pockets |
| Optional wheel | American, double zero — 38 pockets |
| Optional rule | La Partage — a zero returns half of an even-money bet |
| Bets | Every standard inside and outside bet |
| Multiple bets | Any number of bets may be placed on one spin |
2. The bets and their odds
| Bet | Numbers covered | Pays |
|---|---|---|
| Straight up | 1 | 35:1 |
| Split | 2 | 17:1 |
| Street | 3 | 11:1 |
| Corner | 4 | 8:1 |
| Five number (American only) | 5 | 6:1 |
| Six line | 6 | 5:1 |
| Column | 12 | 2:1 |
| Dozen | 12 | 2:1 |
| Red / Black | 18 | 1:1 |
| Odd / Even | 18 | 1:1 |
| High / Low | 18 | 1:1 |
Every bet on a single-zero wheel has exactly the same house edge — 2.70 %. That is the defining property of roulette and the reason it is worth stating in the help screen: no bet is better than any other, and any system built on mixing them cannot change the edge.
The one exception is the five-number bet, which exists only on the American wheel and returns 7.89 % instead of 5.26 %. It is the worst bet on the table and the only place where a roulette player can choose badly.
3. Why the edge is the same for every bet
On a single-zero wheel every bet paying n:1 covers exactly 36/(n+1) numbers. A straight-up bet pays 35:1 and covers 1; a dozen pays 2:1 and covers 12; red pays 1:1 and covers 18. In each case the return is
covered / 37 × (n + 1) = 36/37 = 0.972973
so the edge is 1/37 = 2.7027 % regardless. The five-number bet breaks the pattern because 5 × 7 = 35, not 36 — it is paid as though it covered 5⅐ numbers.
4. La Partage halves the edge, and only on even-money bets
With La Partage a zero returns half the stake on red/black, odd/even and high/low. That takes those bets from 2.70 % to 1.35 % — the best bet available in any casino game in this kit. It does not apply to inside bets, and implementations that apply it everywhere give the game away.
5. Sources consulted
- The Wizard of Odds' roulette analysis — the 2.70 % single-zero and 5.26 % double-zero edges,
- Published wheel layouts — the pocket orders in §6, and the eighteen red numbers. Both are
the 7.89 % five-number bet, the 1.35 % La Partage figure, and the full bet/odds table in §2. Confirms every figure this game is verified against.
presentation rather than mathematics, but a wrong red set silently changes the red/black bet.
6. Wheel order is presentation, red/black is not
The physical pocket order matters for how a spin looks and for neighbour bets, and it is not numeric order:
- European: 0, 32, 15, 19, 4, 21, 2, 25, 17, 34, 6, 27, 13, 36, 11, 30, 8, 23, 10, 5, 24, 16,
- American: 0, 28, 9, 26, 30, 11, 7, 20, 32, 17, 5, 22, 34, 15, 3, 24, 36, 13, 1, 00, 27, 10,
33, 1, 20, 14, 31, 9, 22, 18, 29, 7, 28, 12, 35, 3, 26
25, 29, 12, 8, 19, 31, 18, 6, 21, 33, 16, 4, 23, 35, 14, 2
The red numbers are 1, 3, 5, 7, 9, 12, 14, 16, 18, 19, 21, 23, 25, 27, 30, 32, 34, 36 — and that set is mathematics, because it defines the red/black bet. It is asserted directly rather than derived from a pattern, because the pattern breaks twice (at 10-11 and at 28-29).
7. This game is fully enumerable
There are 37 or 38 outcomes. Every figure in this document is computed by summing over all of them, exactly, with no simulation anywhere. Roulette is the one game in the kit where that is trivial — which makes it the right place to assert the uniformity of the edge across every bet, something no simulation could establish convincingly.
8. Deliberate deviations
- No En Prison. It imprisons the bet for a further spin, which needs state that survives a
- No neighbour or "call" bets (voisins, orphelins, tiers). They are wheel-order bets and are
- No racetrack betting surface. Same reasoning.
round; La Partage reaches the same 1.35 % without it and ships instead.
presentation-driven; the layout is shipped so they can be added.
9. Achieved figures — exact, every one
Computed by summing over all 37 or 38 outcomes. Nothing here is simulated.
European, single zero
| Bet | Numbers | Pays | Return | Edge |
|---|---|---|---|---|
| Straight up | 1 | 35:1 | 97.2973 % | 2.7027 % |
| Split | 2 | 17:1 | 97.2973 % | 2.7027 % |
| Street | 3 | 11:1 | 97.2973 % | 2.7027 % |
| Corner | 4 | 8:1 | 97.2973 % | 2.7027 % |
| Six line | 6 | 5:1 | 97.2973 % | 2.7027 % |
| Column | 12 | 2:1 | 97.2973 % | 2.7027 % |
| Dozen | 12 | 2:1 | 97.2973 % | 2.7027 % |
| Red / Odd / Low | 18 | 1:1 | 97.2973 % | 2.7027 % |
Ten bets, one number. Every return is 36/37 to twelve decimal places, and the test asserts the identity behind it directly: coverage × (odds + 1) = 36, exactly, for every bet on the layout.
American, double zero
Every bet is 5.2632 % — except one:
| Bet | Numbers | Pays | Return | Edge |
|---|---|---|---|---|
| Five number | 5 | 6:1 | 92.1053 % | 7.8947 % |
5 × 7 = 35, not 36. That single arithmetic failure is the whole reason the bet is bad, and the test asserts it as such rather than just checking the percentage.
La Partage
| Bet | Edge |
|---|---|
| Red / Odd / Low | 1.3514 % |
| Everything else | 2.7027 %, unchanged |
Exactly 1/74. The test asserts that inside bets are untouched, which is the half of the rule implementations get wrong.
A three-pocket split
The exact-math test caught a real fault on its first run. Split originally took the lower number as its parameter, but 17 sits beside 18 across the layout and above 20 down it — two different bets. Covering both made a split pay 17:1 on three pockets: a return of 145.9 % and a 46 % player edge.
The parameter now packs the orientation alongside the number. It is the kind of fault a simulation would have surfaced eventually and an exact calculation surfaces instantly, in a game where the right answer is a single number repeated ten times.
BetTypeId gained equality operators
Roulette is the first game whose settlement switches on bet type — one slip carries eleven kinds — and type == RouletteBets.Colour did not compile. == and != were added to BetTypeId in the rules kernel; it already implemented IEquatable, so this only closes the gap.
10. Worked examples (become the first unit tests)
- Every bet on the single-zero wheel returns exactly 36/37.
- The American five-number bet returns 30/38, an edge of 7.89 %.
- Red covers exactly 18 numbers, and 10 and 28 are black while 9 and 27 are red.
- Zero is neither red nor black, neither odd nor even, neither high nor low — every even-money
- A straight-up win on 100 returns 3,600, being the stake plus 35:1.
- La Partage returns 50 of a 100 red bet when zero comes up, and nothing on a straight-up bet.
bet loses to it.
11. Definition of done
Tracked against the 16-point checklist in the Adding a Game section in this guide.
9. v1.1 addendum - combination tap zones and the American board
v1.0 shipped the combination bets rules-complete but with no tap zones; v1.1 authors them.
Sources (2):
- Wizard of Odds, "Roulette" - the inside-bet catalogue (split, street, corner, six line,
- Wikipedia, "Roulette" - the table layout: where each combination chip physically sits
five-number/top line), their pays, and the five-number bet's 7.89 % edge on a double-zero wheel.
(shared edges, vertices, row ends), the 0/00 head of an American layout, and the bet-coverage counts.
The zones. RouletteBoardPlan is the single source of truth: 57 splits (24 across the layout, 33 down it), 12 streets, 22 corners, 11 six lines - 102 zones on a European board, plus the five-number top line on an American one. The authoring places one translucent tap zone per entry, deriving its position from the bet's own param: splits on shared cell edges, corners on shared vertices, streets and six lines at the row ends. Every zone is an authored button; nothing is spawned at runtime.
The invariant the tests pin. Every standard zone satisfies coverage x (odds + 1) = 36 - a split covers 2 at 17:1, a corner 4 at 8:1, a six line 6 at 5:1 - which is exactly why every one of them has the same edge: 1/37 (2.70 %) European, 2/38 (5.26 %) American. The five-number bet is the sole exception: 5 x 7 = 35, so its edge is 3/38 = 7.89 %, the worst on the board. The exact-cover suite also proves the zones blanket the layout with a physical board's adjacency counts (a corner number touches 2 splits, an interior number 4, every number exactly one street, and so on).
The American toggle. The wheel kind on RouletteConfig re-shapes the authored board at Start: American activates the authored 00 cell (straight-up on pocket 37) and the five-number zone, and shrinks the full-width 0 cell to the 00 cell's mirrored half-width footprint; European hides them and restores the authored 0. No cells are created or destroyed either way.
Deliberate deviations. Zero-adjacent splits (0-1, 0-2, 0-3), the trio and the basket are omitted: this board authors the zero row as full-width cells, so the three-column zero border those chips physically straddle does not exist. Recorded here rather than silently dropped.
12. v1.2 presentation and betting-workflow addendum
The rules and probabilities above are unchanged. The table now presents the precommitted result through a visible rotor/ball sequence with named orbit, drop and pocket-search stages. A distinct pocket impact is aligned with BallLanded, after which an authored dolly marks the exact winning straight-up cell until the next spin. This is presentation only: the animation never chooses or alters the outcome.
Every placed chip uses a fixed physical diameter regardless of whether the target covers one, two, three, four, six, twelve or eighteen pockets. Multiple equal-denomination chips stack at a stable offset rather than shrinking. The live table discloses chip count, total stake, best-case net and maximum gross return; settled rounds disclose the exact pocket, colour, gross return and net result, plus an eight-spin session history.
REBET restores the exact accepted layout from the previous spin, DOUBLE duplicates every current slip if the wallet can fund the full copy, UNDO removes the most recently placed slip, and CLEAR returns every current slip. These are betting conveniences only and do not quantize the freely selected wager to chip denominations. A snapshot is taken only when a funded spin is accepted, so failed actions cannot corrupt the previous layout.
The standard rectangular layout remains the shipped surface. Racetrack/favourite/autoplay tools are not simulated by decorative controls: they remain explicit future editor/persistence features, and neighbour/call bets remain the mathematical deviations already recorded above.
Sic BoTables · table_sicbo+
Family: Tables · Complexity: M · Phase 5 · Reference house edge: 2.78 % (Small/Big) to 18.98 %
Written before any code, per the Adding a Game section in this guide step 1.
1. The shipped rule set
| Rule | Shipped value |
|---|---|
| Dice | Three, six-sided, fair — 216 equally likely outcomes |
| Round | A single roll resolves every bet |
| Bets | Small/Big, Odd/Even, totals, triples, doubles, single numbers, two-dice combinations |
Sic bo has no decisions and no state. One roll, every bet settled — which makes it the simplest game in the kit to implement and one of the most interesting to compute, because the spread of house edges across its betting surface is enormous.
2. The bets
Even-money bets — the best bets on the layout
| Bet | Wins on | Pays | Edge |
|---|---|---|---|
| Small | Total 4–10, no triple | 1:1 | 2.78 % |
| Big | Total 11–17, no triple | 1:1 | 2.78 % |
| Odd | Odd total, no triple | 1:1 | 2.78 % |
| Even | Even total, no triple | 1:1 | 2.78 % |
A triple loses all four. That exclusion is the entire house edge on these bets: without it they would be exactly even money on an even split, and the game would break.
Totals
| Total | Ways (of 216) | Pays | Edge |
|---|---|---|---|
| 4 or 17 | 3 | 60:1 | 15.28 % |
| 5 or 16 | 6 | 30:1 | 13.89 % |
| 6 or 15 | 10 | 17:1 | 16.67 % |
| 7 or 14 | 15 | 12:1 | 9.72 % |
| 8 or 13 | 21 | 8:1 | 12.50 % |
| 9 or 12 | 25 | 6:1 | 18.98 % |
| 10 or 11 | 27 | 6:1 | 12.50 % |
Totals 9 and 12 pay the same 6:1 as 10 and 11 but occur less often — 25 ways against 27. Same payout, different probability, and a house edge of 18.98 % against 12.50 %. It is the clearest example in the whole kit of a paytable row that looks fair and is not.
Triples, doubles and singles
| Bet | Wins on | Pays | Edge |
|---|---|---|---|
| Specific triple | Three of a chosen number | 180:1 | 16.20 % |
| Any triple | Any three of a kind | 30:1 | 13.89 % |
| Specific double | At least two of a chosen number | 10:1 | 18.52 % |
| Single number | Pays by how many show | 1:1 / 2:1 / 3:1 | 7.87 % |
| Two-dice combination | Both chosen numbers appear | 5:1 | 16.67 % |
The single-number bet looks like the worst on the table and is nearly the best. It pays 1:1 for one appearance, 2:1 for two and 3:1 for three, and that ladder brings it to 7.87 % — better than every total bet except 7/14.
3. Every figure is exact
Three dice give 216 outcomes. Every bet in §2 is computed by walking all of them and counting. There is no closed form to get wrong and nothing to simulate — which makes sic bo the right place to assert that a paytable is internally consistent, not merely that each row matches a source.
4. Sources consulted
- The Wizard of Odds' sic bo analysis — the 2.78 % Small/Big edge, the full totals table with
- Published casino sic bo layouts — the payout odds themselves, the rule that a triple loses
- Evolution Super Sic Bo — a modern, readable layout containing Small/Big, Odd/Even, totals,
its 18.98 % outlier on 9 and 12, and the triple, double, single and combination edges in §2. Confirms every figure this game is verified against.
Small and Big, and that a specific double wins on at least two rather than exactly two.
singles, doubles, triples and all fifteen two-dice combinations, presented through a visible custom dice shaker. The shipped game borrows those interaction principles, not its multiplier math.
5. Deliberate deviations
- Totals 5 and 16 pay 30:1. An 18:1 variant is common in some markets and is worse (28.16 %);
- No four-number or three-number combination bets. They exist on some layouts and are rare.
the paytable is data, so both are configurable, and the shipped default is the better one.
6. Achieved figures — exact, all 52 bets
| Bet | Ways | Return | Edge |
|---|---|---|---|
| Small / Big / Odd / Even | 105/216 | 97.2222 % | 2.7778 % |
| Single number (any face) | 91/216 | 92.1296 % | 7.8704 % |
| Total 7 or 14 | 15/216 | 90.2778 % | 9.7222 % |
| Total 8, 10, 11 or 13 | 21 or 27/216 | 87.5000 % | 12.5000 % |
| Total 5 or 16 | 6/216 | 86.1111 % | 13.8889 % |
| Any triple | 6/216 | 86.1111 % | 13.8889 % |
| Total 4 or 17 | 3/216 | 84.7222 % | 15.2778 % |
| Specific triple | 1/216 | 83.7963 % | 16.2037 % |
| Total 6 or 15 | 10/216 | 83.3333 % | 16.6667 % |
| Two-dice combination | 30/216 | 83.3333 % | 16.6667 % |
| Specific double | 16/216 | 81.4815 % | 18.5185 % |
| Total 9 or 12 | 25/216 | 81.0185 % | 18.9815 % |
Every figure matches its published value exactly.
Four claims the tests make beyond matching a table
**The six triples are the house edge on Small and Big.** The test asserts 105 + 105 + 6 = 216 — so the exclusion is shown to account for the entire 2.78 %, rather than the percentage merely being checked. Without it the two bets would split the sample space evenly and the game would not work.
Totals 9 and 12 are proved worse than 10 and 11 at the same odds. Both rows pay 6:1; 9 has 25 ways and 10 has 27. The test asserts the payouts are equal and the edges are not — 18.98 % against 12.50 %. It is the clearest paytable row in the kit that looks fair and is not.
The single-number bet is proved better than it looks. Rather than checking 7.87 %, the test asserts it beats every total bet except 7 and 14. The 1:1 / 2:1 / 3:1 ladder is doing more work than the layout suggests.
The four even-money bets are proved best. The test scans all 52 bets and asserts the minimum edge belongs to Small, Big, Odd or Even.
Mirror symmetry is asserted throughout: every total t matches 21 − t to twelve decimal places, and all six faces give identical triple, double and single edges. A paytable that was right on one side and wrong on the other could not survive that.
The rules core is checked against the enumeration
400,000 rolls through the actual rules core: measured Small rate 0.484368 against the exact 0.486111.
7. Worked examples (become the first unit tests)
- Small and Big are each exactly 105 of 216 — 107 totals minus two triples.
- A triple loses both Small and Big, even a total of 6 made as 2-2-2.
- Total 9 has 25 ways and total 10 has 27, and both pay 6:1.
- A specific double wins on a triple too — three 4s wins the "double 4" bet.
- A single number pays 3:1 on a triple, not 1:1.
- The 216 outcomes sum to 1 across any complete partition of the sample space.
8. Definition of done
Tracked against the 16-point checklist in the Adding a Game section in this guide.
9. Physical presentation contract (v1.2)
- The three authored dice shake beneath a lidded cup and are revealed physically; the action never
- The result HUD states total and Small/Big, Odd/Even or Triple classification, retains five totals,
- Every layout category matched by the dice glows green. Every committed losing wager glows red.
- Rebet restores the exact previous 52-spot layout, Undo removes the last chip placement, and the
- Portrait and bespoke landscape layouts, skip parity, mechanic-aligned dice impact audio and
jumps from wager to final text.
and always reports exact total return and net.
live HUD enumerates all 216 outcomes to show the best compatible gross return.
allocation-free authored objects are automated release gates.
Third-party notices and contact
Kenney Casino Audio
The included Kenney casino audio is distributed under the notice reproduced below. This notice is consolidated here so the package retains exactly one buyer-facing documentation file.
Casino Audio (1.1) by Kenney Vleugels (Kenney.nl) ------------------------------ License (Creative Commons Zero, CC0) http://creativecommons.org/publicdomain/zero/1.0/ You may use these assets in personal and commercial projects. Credit (Kenney or www.kenney.nl) would be nice but is not mandatory. ------------------------------ Donate: http://support.kenney.nl Request: http://request.kenney.nl Follow on Twitter for updates: @KenneyNL
Support
Questions, bug reports, and feature requests: szekipapa77@gmail.com.
Publisher
Szekipapa77 · Complete Casino Kit version 1.2.0.