Every engine
03Engine

Card market

A hand is dealt one card at a time against a dealer; the player buys YES or NO on "the player hand beats the dealer" at the fair price of that moment and may sell later at the fair price of that moment.

Kind
a traded market on a dealt hand
Largest win
Set by the play, not by a table
Name in the files
card_market
Version
17519157b251

Download this engine as one file

What the player sets

Nothing before the round: the choices are made during it.

Every round also takes the return dial in basis points, 9600 to 9900, and a stake.

The round, in order

  1. each card: rank = int_below(13) (an endless deck, so every price is exact); ranks 0 to 8 count 2 to 10, 9 to 11 count 10, 12 is an ace (11, or 1 when the hand would be over 21)
  2. the player hand gets the first card and the dealer the second; then the player hand draws until it has two cards and 17 or more; if it is over 21 the hand is over; then the dealer draws until it has two cards and 17 or more
  3. both hands play themselves: stand on every 17; YES wins when the player hand is 21 or under and the dealer is over 21 or lower; a tie is NO
  4. the price of YES is its exact probability from the cards dealt so far
  5. a position can be bought while the price is between 2% and 98%

int_below(m) is a whole number from 0 to m-1: limit = 2^64 - (2^64 mod m); take values until v < limit; return v mod m. shuffle: Fisher-Yates from the end, j = int_below(i+1). Words: HMAC-SHA256(key = seed, "STORM-DRBG|" || u64be(j)), cut into big-endian u64s.

What the player may do

  • next: deal the next card
  • buy_yes, buy_no
  • sell

What it pays

A position bought at probability p pays rtp / p (x10k, as rtp x 10^6 div p in parts per million) if it wins; sold earlier it pays rtp x (probability now / p). With no position at the end the stake comes back. The dial is taken once, on the buy, so the return is the dial however the player trades.

Tables

No table: a traded market, not a table. What is paid follows from the steps above.

On Storm

In Storm’s core this engine is built from this page as written, with the settings and the largest win above, and is right when it reproduces the test rounds below. The rest of this part is about the templates Storm has live today, which is the way onto Storm until then.

Our reading against Storm’s templates: does not fit. A traded market, not a table.

On the templates it would take: a card template. Storm lists it as not enabled.

Check a build against ours

48 whole rounds, each from a seed given in the file. A build is right when, from the same seed, settings, dial and actions, it makes the same draws in the same order and pays the same amount. The seed of a test round is sha256("rain-engine-vector|<engine>|<case>|<rtp_bps>|<i>"), given in hex in each vector.

buy no after two cards, hold, dial 9900
seed 60a22508922f7b351b72c4baf46c1371c72f8ccad071ac000af35584cba04dc0
settings {}
actions [["next"],["next"],["buy_no"],["next"],["next"],["next"]]
draws int_below(13) = 3, int_below(13) = 10, int_below(13) = 0, int_below(13) = 5, int_below(13) = 11
pays 1.3649x (payX10k 13649)
buy yes before any card, hold, dial 9900
seed 2b86851f8d3ca6cbbd7677a52800e163f158dfe7304ffce79e52c04e5ea1e4ca
settings {}
actions [["buy_yes"],["next"],["next"],["next"],["next"]]
draws int_below(13) = 6, int_below(13) = 5, int_below(13) = 7, int_below(13) = 10
pays 0x (payX10k 0)

The rest are in this engine’s file, with the full result of each round. The reference build plays this engine and reproduces every one of them.

Nothing hidden is fixed when a round starts: what a step shows is drawn at that step. So the same file holds 48 more rounds played with a seed of its own for the start and for every action after it, as a round runs where each step’s randomness is formed only after the player has acted. The rules are the same; only the generator is started afresh at each step.