Hi Jim,

Good point. If you have a fairly large list of used cards in a deck it
would take a while for the random generator to select one of the cards
that haven't been selected. That would probably require several
iderations of the while loop which would definitely slow things down.
In a case like that shuffling the deck would be more practical as it
could quite litterally just pick the next card out of the array and
use it without trying to hit or miss several times before landing on
an unused card. Of course, in some card games like War you'd
definitely have to shuffle the deck before dealing them out as it
would operate much smoother in splitting the deck properly.

On 11/26/10, Jim Kitchen <j...@kitchensinc.net> wrote:
> Hi Thomas,
>
> Yes, I know that you can just check to see if that card has been picked
> before like you said.  However when you get to like forty some of the cards
> have been picked you may end up picking a used card over and over and over
> thus taking time to finally pick an unused card.  And one wants to use up
> most of the deck before shuffling the deck because that is how they do it in
> a casino.  You know so that black jack players can count cards and beat the
> casino.  So that is why I wanted my game to be as much like playing in a
> casino for practice before going to a casino.  Plus like I said I just think
> that setting up an actual shuffled deck is a better programming practice.
>
> TGIF and BFN
>
>      Jim
>
> Experience is something you don't get until just after you need it.
>
> j...@kitchensinc.net
> http://www.kitchensinc.net
> (440) 286-6920
> Chardon Ohio USA
> ---
> Gamers mailing list __ Gamers@audyssey.org
> If you want to leave the list, send E-mail to
> gamers-unsubscr...@audyssey.org.
> You can make changes or update your subscription via the web, at
> http://audyssey.org/mailman/listinfo/gamers_audyssey.org.
> All messages are archived and can be searched and read at
> http://www.mail-archive.com/gam...@audyssey.org.
> If you have any questions or concerns regarding the management of the list,
> please send E-mail to gamers-ow...@audyssey.org.
>

---
Gamers mailing list __ Gamers@audyssey.org
If you want to leave the list, send E-mail to gamers-unsubscr...@audyssey.org.
You can make changes or update your subscription via the web, at
http://audyssey.org/mailman/listinfo/gamers_audyssey.org.
All messages are archived and can be searched and read at
http://www.mail-archive.com/gam...@audyssey.org.
If you have any questions or concerns regarding the management of the list,
please send E-mail to gamers-ow...@audyssey.org.

Reply via email to