Are cribbage apps rigged? How Card Table shuffles the deck
Card Table's deck isn't rigged, and you can check it. Each hand starts from a random number taken from the iPhone's secure random source, and a standard Fisher–Yates shuffle turns it into the order of all 52 cards before anyone plays. The difficulty level, the score and the computer have no say in that order, and the computer never sees your hand or the rest of the deck.
Every card game app gets the same review sooner or later: the computer cheats. Sometimes it’s said about the cut, sometimes about the deal, and almost always right after a run of bad hands. Most apps can’t answer it beyond “no, it doesn’t”, because nobody outside can look.
So this page shows how Card Table does it: where the shuffle comes from, when the order of the deck is fixed, what the computer is allowed to know, and what happened when we ran the app’s own shuffle a million times.
Where does the shuffle come from?
Each new hand starts with one random number, 64 bits long. Card Table takes it from Swift’s SystemRandomNumberGenerator, which on iPhone and iPad draws on the operating system’s cryptographically secure random source (Apple’s documentation). That is the same kind of randomness the phone uses for encryption keys, and nothing in the game, not the score, the level or the last hand, feeds into it.
That number is called the seed. A small generator called SplitMix64 stretches it into a stream of numbers, and the deck is shuffled from that stream with the Fisher–Yates method: go through the deck from the last card to the first, and swap each card with a card picked at random from the ones not yet placed. Done that way, every order the generator can reach is equally likely; the method goes back to Fisher and Yates in 1938 and is the one Knuth gives in The Art of Computer Programming (a full description).
Card Table uses its own few lines of Fisher–Yates rather than Swift’s built-in shuffle, for one reason: Swift may change its built-in method in a later version, and then a saved seed would no longer give the same deal. With the method fixed, the same seed always gives the same deck, which is what makes a replay possible.
When is the order of the deck decided?
All of it is decided at the deal, before anyone looks at a card.
In Cribbage the 52 cards are shuffled, 6 go to each player one at a time, and the 13th card down is the starter. The starter is already sitting in its place while you choose your discards for the crib. Nothing is drawn after you decide, so the cut can’t be picked to punish what you kept.
In Gin Rummy the first 20 cards are dealt 10 each, the 21st is the upcard, and the rest is the stock, in the order the shuffle left it. Taking from the stock takes the next card in that order, whichever of you takes it.
Who deals first is settled the same way, by a cut drawn from a shuffle at the start of the game.
What can the computer see?
The computer opponent doesn’t read the game’s memory. Each time it has to move, it is handed a view of the table made for its seat, and it decides from that alone. In Gin Rummy that view holds:
- its own 10 or 11 cards
- the discard pile
- the cards you picked up from the discard pile and still hold, and the cards you have thrown
- how many cards are left in the stock, but not which
In Cribbage it holds its own cards, the two it put in the crib, the starter once it’s turned, and the cards played on the count. Your hand and the crib reach it at the show, when they’re laid out for you too.
The levels differ only in how well the computer uses that view. Easy sometimes plays a weaker card on purpose, as a casual player would. Hard never does: in Gin Rummy it avoids throwing cards you’ve shown you collect, and in Cribbage it estimates the crib from 100 sampled possibilities and plays out the rest of the count against hands you might hold, drawn only from cards it hasn’t seen. None of that changes the cards.
Does the difficulty change the deal?
No. The seed comes from the same secure source at every level and in 2-player games. Card Table has no setting, hidden or not, that steers the cards toward either player.
We didn’t want to leave that as a promise, so we ran the app’s own deck and scoring code outside the app and measured it.
| Test | Result |
|---|---|
| 1,000,000 shuffles: how often each of the 52 cards landed in each of the 52 places | Within chance everywhere: a chi-squared value of 2,605 against 2,601 expected for a fair deck |
| 200,000 Cribbage deals: the best 4 cards each player could keep, counted with the starter | You 9.00 points on average, the computer 8.99 |
| 200,000 Gin Rummy deals: deadwood in the 10 cards dealt | You 56.6 points on average, the computer 56.5 |
The two players alternated as dealer, just as they do in a game. The small differences between you and the computer are the size you’d expect from chance in a test this long, and they don’t lean the same way twice.
Why does it feel rigged anyway?
Because a fair deck streaks more than people expect. Using the same Cribbage deals, we counted how often the computer was dealt the better cards several hands in a row during a game of 9 hands:
- 3 or more hands in a row: about 1 game in 3
- 4 or more in a row: about 1 game in 7
The computer’s cards were strictly better on about 45% of hands, the player’s on about as many, and the rest were tied, so the same streaks run in your favour just as often. Yours are simply easier to forget, because a game you win with good cards doesn’t make anyone wonder about the shuffle.
The other source of doubt is the show itself. A 24-point hand sticks in the memory; dozens of 4- and 6-point hands don’t. If you want to know what a hand was really worth, how to count a cribbage hand works through the scoring line by line.
How can you check a deal yourself?
You don’t have to take any of this on trust while you play:
- Look at both hands. After every hand, the computer’s cards are laid out face up next to yours. In Cribbage the crib is turned over too, and every hand is counted line by line.
- Replay the deal. Replay this deal plays the same shuffle again from the same score: the same cards, the same starter or stock, the same dealer. Play it differently and you’ll see whether the hand was lost in the cards or in the play. A replay never counts toward your record.
- Use the Hint. The Hint button shows what the Hard computer would play with your cards, so you can compare its choices with yours on the same deal.
Is there anything the shuffle can’t do?
One honest limit. A 64-bit seed can produce about 18 quintillion (1.8 × 10^19) different decks. A deck of 52 cards can be arranged in about 8 × 10^67 ways, so most possible orders can never come up. That limits how many decks exist, not how fair they are: every seed is as likely as every other, and no one, the app included, can choose or predict it. It also won’t repeat on you. Play a hand every 10 seconds for 50 years, about 160 million hands, and the chance of being dealt the exact same deck twice is under 1 in 1,000.
Where to read more
- A cribbage app without ads for iPhone: what else to check before you install one
- Gin Rummy scoring: knocks, gin, undercuts and the game bonus
- Card Table on the App Store: Cribbage and Gin Rummy with no ads, offline and with no account
Questions
- Are cribbage apps rigged?
- Most apps don't show how they shuffle, so you can't check. Card Table does. Every deal comes from the iPhone's secure random source and a standard Fisher–Yates shuffle, the order is fixed before the first card is played, and Replay this deal plays the same shuffle again so you can see it was the cards, not the app.
- Does the computer get better cards on Hard?
- No. Every level uses the same shuffle. Hard plays its cards better; it isn't dealt better ones. Over 200,000 test deals the computer's cards and the player's were as good as each other in both games.
- Can the computer see my cards in Card Table?
- No. In Gin Rummy it sees its own hand, the discard pile and the cards you have picked up from it or thrown. In Cribbage it sees its own cards, the starter and the cards played on the count. Your hand is shown to it only at the show, the same moment it's shown to you.
- Why does the computer get good hands so often?
- Streaks are normal with a fair deck. In a 9-hand game of cribbage, the computer is dealt the better cards 3 or more hands in a row in about 1 game in 3, and 4 or more in about 1 game in 7. The same happens in your favour just as often; those runs are just easier to forget.