Skip to content
UniKit

Card-flip lottery

A card-flip lottery you can actually play: prizes and counts (such as first prize x1 or second prize*3) are shuffled into a deck by unit, and clicking a card, pressing number keys 1–9 or hitting Space flips it while flipped / prizes hit / unflipped and the hit rate update live. The shuffle uses only the seed (mulberry32, 20260101 by default) and never reads the clock, so the same prizes plus the same seed reproduce which card holds what.

Runs in your browserEvery computation happens in your browser — your data never leaves this device.

Board (click a card to flip it)

Click a card, press a number key or hit Space; the shuffle depends only on the seed, so which card holds which prize is reproducible.

Slots:10Flipped:0Prizes hit:0Unflipped:10
10 slots · 0 flipped · 0 prizes hit · 10 left
Slots
10
Flipped
0
Prizes hit
0
Unflipped
10
Hit rate
0%
Seed
20260101

Keyboard: number keys 1–9 flip that card, Space / Enter flips the next one (click the board first to focus it).

Dealt 10 cards with seed 20260101.
牌位 10 张 / Cards: 10
奖项配置 / Prizes: 一等奖×1 · 二等奖×2 · 谢谢参与×7

牌面 / Board:
#1:??  #2:??  #3:??  #4:??  #5:??  #6:??  #7:??  #8:??  #9:??  #10:??

已翻 / Flipped: 0 · 已中奖 / Won: 0

What this tool does

  • Run an office-party draw: list the prizes, get ten cards laid out, and click whichever card you like — flipped cards show their face.
  • Settle a dispute afterwards: with the seed fixed, "card 5 is the first prize" can be verified again and again, and only a new seed changes the order.
  • Tune the win rate: the number of units sets the odds (1 first prize, 2 second prizes, 7 blanks ≈ 10% / 20% / 70%), blank slots pad the rest, and flipped / prizes hit / unflipped plus the hit rate update live.

Example

Input

First prize x1
Second prize x2
Thanks for playing x7 (seed 20260101, ten slots)

Output

牌位 10 张 / Cards: 10
奖项配置 / Prizes: 一等奖×1 · 二等奖×2 · 谢谢参与×7

牌面 / Board:
#1:??  #2:??  #3:??  #4:??  #5:??  #6:??  #7:??  #8:??  #9:??  #10:??

已翻 / Flipped: 0 · 已中奖 / Won: 0

The real output before anything is flipped. Clicking card 5 flips the first prize (the fixed order for seed 20260101), and clicking it again says "That card has already been flipped".

Frequently asked questions

How do I flip cards?

Click any card to flip it; you can also click the board first and then press number keys 1–9 to flip that card, or press Space / Enter to flip the next unflipped card. "Reshuffle" re-deals with the current seed and "Restore example" returns to the default prizes and seed.

Why is the draw reproducible?

The shuffle uses a built-in mulberry32 seeded PRNG with the seed you set (20260101 by default); nothing reads the clock and nothing samples true randomness. The same prizes and the same seed always give the same deck, so which card holds which prize can be verified afterwards. Change the seed for a new order.

How do prize units relate to the odds?

Cards are dealt by unit: with "first prize x1, second prize x2, thanks for playing x7" the ten cards contain 1 first prize, 2 second prizes and 7 blanks — a 10% / 20% / 70% split. There is no extra weighting: the unit counts are the probabilities.

What exactly does "prizes hit" count?

It counts flipped cards whose face is one of the declared prizes. So if you also list "thanks for playing" as a prize, flipping it counts as a hit; to avoid that, leave it out of the list and let the "pad with blank slots" option fill the losing cards automatically.

How do slots and prize units relate?

With the slot count empty it equals the total prize units. If set, it cannot be smaller than the total prize units (that raises "too few slots"); when it is larger the extra slots are padded with blanks by default, and switching the padding option off raises an error instead of silently handing out fewer prizes. Slots cap at 200, a single prize at 500 units and the list at 100 entries.

How do I write the prizes?

One prize per line with the count after the name joined by x, × or *, for example "一等奖 x1" or "二等奖*3"; without a count the prize gets one unit. An empty name or a count below 1 is reported as an error rather than being dropped silently.

Keywords:card flip lottery

Related tools