Hi --

On Fri, 17 Mar 2006, grrr wrote:

> So suppose you have a deck of cards, that might have some number of cards.
>
> First the cards are shuffled, in effect placed in random order.
>
> Then the deck is split, ie. some number of cards are lifted from the top
> of the deck and placed under the remaining cards.
>
> How would one implement this? I was thinking of using an array, but how to
> shuffle the deck, and how to split the deck?

I have to say, it only dawned on me just now that it's kind of funny
to cut the deck when the dealer is a computer.  The idea of cutting
the deck is to thwart attempts by the dealer to stack the deck.  I
actually kind of love the idea that one has to do this in the case of
a computer :-)


David

-- 
David A. Black (dblack / wobblini.net)
Ruby Power and Light, LLC (http://www.rubypowerandlight.com)

"Ruby for Rails" chapters now available
from Manning Early Access Program! http://www.manning.com/books/black