# How to give each player in card game the same shuffled deck?

I'm writing a card game in Swift. The idea is to make it work on the Apple Game Center framework. I've noticed an issue which I am not sure how to address.

• I need the current game data to be the same for all players.
• There are 6 players in the game.
• There is a deck of 30 cards, they are shuffled.
• Each player must have the same deck of cards (post-shuffle).
• 6 cards are presented to the "table" one at a time (animation).

There are also other activities that a player does that are outside the bounds of this question.

My question is this;

How do I give each player the same shuffled deck of cards?

There are a couple of options I can think of, but perhaps none of these are the best way; hence my question

1. The start player is the host. The host creates the shuffled deck, and this deck is sent to other players (ie: JSON); in short all activities are facilitated through him.

The problem with this is that the start player could lose internet, abandon the game or all sorts?

So I don't think this is a viable solution

1. There is a middleman, the server.

There is a "lobby" (waiting area) There is multiple games. The game has players. An AI-bot could be used to fill in abandoned players

But wait, does this then mean the server shuffles the cards and sends the same data to all players and makes the players "thin clients"?

Can Apple's Game Center handle this for me?

I'm not sure about the best solution for this?

• My immediate reaction was "use a seed." The seed could be arbitrary (such as "time in milliseconds since UTC 0" or whatever) so long as the value of that seed can be saved. Then a connecting player only needs two pieces of information: the seed (to shuffle the deck) and the number of cards already removed from the top. – Draco18s no longer trusts SE Jan 11 '16 at 21:05
• Seeds sounds interesting idea. – zardon Jan 11 '16 at 22:51