View Single Post
  #33  
Old 09-10-2007, 06:46 AM
qpw qpw is offline
Senior Member
 
Join Date: Jul 2007
Posts: 267
Default Re: Funny FullTilt Business

[ QUOTE ]
Actually, when using a software PRNG, there's no particular reason to generate an entire shuffled deck at the start of the hand. As long as you maintain a separate seed state for each hand in progress, you get the exact same results with less computation and memory usage by dealing one card at a time (although it's unlikely that shuffling would account for a large percentage of server load in any case). When using hardware generators, it typically would change the results, but it would be hard to construct a scenario where you'd detect the difference.

I doubt anybody would pick a random card and then discard it if it'd already been used in the hand. It's simpler to just keep a list of unused cards and pull one at random.

[/ QUOTE ]
It might be slightly more efficient to make a linked list of cards and remove them as they are dealt, the greater complexity of getting a card being offset by the omission of the sort - I've never benchmarked it, but it is trivially easy to just generate the deck in once go.

I can't really see why anyone would care about separate seeds for each hand. What they care about is whether or not the cards are random, not that they relate to a specific sequence from a PRNG.
Reply With Quote