Re: Card dealing and random repetition



Gerry Quinn wrote:

In article <%0AVf.32718$nz4.4826@xxxxxxxxxxxxxxxxxxxxx>,
simaldeff@xxxxxxxxx says...
I though about something while reading your post.
Have you ever seen someone shuffle a deck? array
it's quite interesting, and
inspiring for an 'elegant' way to simulate a shuffle.
example 1 : Poker dealer "show off"
The dealer divide the deck in two parts, array
trying to make them equally big
(but I estimate the error margin being between 1 to 5 cards from the
count of 26 cards per half-deck). Then he shuffle them trying to
alternate 1 card from the right-half-deck and one from the
left-half-deck (here there is a slight probability of 2 card staying
stuck together and not being separated during the shuffle, the
probability of 3 staying unseparated is even slighter and 4 cards is
nearly impossible if the dealer is good at this) array
by bending the cards
and releasing each deck next to each other.array
Then repeat 1 to 3 time and
then deal.
SO doesn't it look simple to emulate in a program?
Take your array of 52 cards.
Divide it in 2 sub arrays, array
with a random error of 1 to 5 cards difference.
Shuffle : adding a random probability of the next card on the array
being picked instead of the next of the other array. array
This probability go
decreasing if this already happened in the previous card.
Repeat it as much as you want.

I think this method looks funnier. Could it have any utility? It's a
direct emulation of the real-world card shuffling.

But mainly it emulates the defects of real-world card shuffling. A
perfect shuffle has no structure of the kind you describe.

"A perfect shuffle" sounds like
it would be a bad thing in a card game.

--
pete
.



Relevant Pages

  • Re: Shuffling less is often good enough. (LSJ Query)
    ... deck, and then cut the deck enough times so that you have no clue as ... to where that card is. ... Eliminating your knowledge of the order is not the same as randomizing ... No matter how much I shuffle, God will always know the order the cards ...
    (rec.games.trading-cards.jyhad)
  • Re: Algorithm for card shuffling
    ... Select the first card at random from the entire deck, ... > typedef Deck::const_iterator ConstDeckIterator; ... > void Shuffle ...
    (comp.programming)
  • Re: unified + sorted array
    ... >> sort array B ... >> the resulting deck is sorted. ... >> Look at the top card of deck B ...
    (alt.comp.lang.learn.c-cpp)
  • Re: I pee in the open
    ... card from an initially ordered deck in a few lines of C code: ... deck with an inexact cut without under/overflow from each half of the deck? ... you don't want a truly random shuffle. ... rand() is usually implemented as pseudo-random number generator ...
    (alt.lang.asm)
  • Re: Card dealing and random repetition
    ... and inspiring for an 'elegant' way to simulate a shuffle. ... The dealer divide the deck in two parts, trying to make them equally big (but I estimate the error margin being between 1 to 5 cards from the count of 26 cards per half-deck). ... adding a random probability of the next card on the array being picked instead of the next of the other array. ...
    (comp.programming)