|
June 07, 2013, 03:46:47 PM |
|
1. Let every player submit a custom 'seed' string (random gibberish), and for convenience offer the option of just having one randomly generated. Also, the server generates a random seed string.
2. The Sha256 hashes of these seed strings are displayed in advance, so everybody can be certain the results were not manipulated afterwards.
3. Concatenate all these seed strings in a deterministic order (e.g. alphabetic) and take the Sha256 hash of the result.
4. Generate a deck of cards from this Sha256 hash, to have a semi-random (deterministic but unpredictable and uniformly distributed) shuffled deck of cards.
As for how to implement step 4: use some big integer math, and interpret the Sha256 hash from step 3 as one big integer number. Take this number modulo 52 to pick the first card, and divide the number by 52. Take the resulting number modulo 51 to pick the second card, and divide the number by 51. Et cetera.
|