Thulla Champions › Guides › The fair shuffle

Is the Thulla shuffle fair? How online dealing works

By Abdul Rauf · Updated

“I keep getting terrible hands” is the oldest complaint in card games. In a game where you cannot see the shuffle, the only honest answer is to explain exactly how it works. This page does that, in plain words, and also says what we do not claim.

Where the shuffle happens

There are two cases, and they are treated differently on purpose.

Friends tables use exactly the same server shuffle as Classic matches. We did not relax anything for private games.

How the server shuffle works

  1. A secret seed. For every match the server asks the operating system for 32 random bytes (256 bits) from its cryptographically secure generator. That seed exists before any card is dealt and is saved with the match.
  2. A stream of random numbers from the seed. The seed is run through SHA-256, together with a counter, to produce as many random numbers as the shuffle needs. The same seed always gives the same numbers, which is what lets us rebuild a deal later.
  3. The Fisher-Yates shuffle. The deck of 52 cards is shuffled with the standard Fisher-Yates algorithm, the textbook way to get an unbiased shuffle: go from the last card to the first and swap each card with a randomly chosen card at or before it.
  4. No modulo bias. A common mistake is to pick a random position by taking a big random number “modulo” the number of choices, which slightly favours small results. We throw away any random number that falls in the leftover sliver and draw again, so every position is exactly equally likely.
  5. Dealing. The shuffled deck is dealt one card at a time round the table until it is gone: 13 each at four players, and 26, 18/17/17, 11/11/10/10/10 or 9/9/9/9/8/8 for two, three, five or six.

Can every deal happen?

There are about 8 × 1067 possible orders of a 52-card deck. A 256-bit seed has about 1.2 × 1077 possible values, so there are more seeds than orders: every order can be reached. The algorithm is unbiased, so they are all equally likely. A weaker design, such as a 32-bit seed, could only ever produce a tiny fraction of the possible deals. Ours is not like that.

Why we keep the seed

Full “provably fair” systems, used by some casino sites, publish a hash of the seed before the deal and the seed afterwards, so players can check it. We do not do that. Coins in Thulla Champions have no cash value, and that machinery would be a lot of complexity for little risk. What we do instead is simpler and gives us a real answer to a complaint: the seed of every match is stored on the server. If you write to us saying the cards in a match looked rigged, we can rebuild that exact deal from its seed and look at it, instead of taking either side on faith. The same seed is also what lets a running match be restored after the server restarts, because the cards themselves are never saved, only the seed and the moves.

What we do not claim. We do not claim that every hand will feel fair. Real random deals contain long runs of bad hands, and people notice them. We claim that nobody chooses the cards, and that if you doubt a match we can check it.

What the bots can see

A shuffle can be perfect and the game still unfair if the opponents secretly know your cards. They do not. Each bot is handed a view of the game rather than the game itself: its own hand, the cards that have left play or been picked up, who threw a thulla on which suit, and how many cards each player holds. That is exactly what a person at your table can see. We keep the real hands out of the bots' reach at the code level, not just by promising that the logic does not look. The bots page shows what a Hard bot works out from that information, and how strong it is.

Because the bots play by public information, even Hard does not always win: against three Easy bots it is still the Bhabhi in about 1 game in 100. See the simulation results.

A test you can run yourself

If you suspect a shuffle, count. Over a hundred games, the Ace of Spades should land with each seat about equally often, and each player should lose about one game in four at a four-player table when playing evenly. A few unlucky games in a row are normal: even strong players are the Bhabhi a quarter of the time against equals.

More: odds of being the Bhabhi · about the project · play now

Frequently asked questions

Is the shuffle in Thulla Champions fair?

Online matches are shuffled on our server from a fresh 256-bit random seed, with an unbiased algorithm, so every possible deal is reachable and equally likely. Nobody, including us, chooses the cards.

Can bots see my cards?

No. Bots only get what any player at the table can see: their own hand, the cards that have been played, who threw a thulla on which suit, and each player's card count.

Do you store the shuffle?

The server stores the random seed of every match, so a deal can be rebuilt exactly if a player reports a problem. The seed is not shown to players during the match.

Is it provably fair?

Not in the cryptographic sense. We do not publish the seed in advance for you to check. We chose to make the deal reproducible for our own audits instead.

Is Practice shuffled on my phone?

Yes. Practice against bots runs on your device with a secure random shuffle, since nobody else is playing and no one can be cheated.

Ready to play? Deal a hand of Thulla right now: it is free and runs in your browser.

Play Thulla now

More guides