Click here to Skip to main content
15,889,116 members
Articles / Programming Languages / C

Random extraction of 5 cards from a deck

Rate me:
Please Sign up or sign in to vote.
4.96/5 (11 votes)
26 Jan 2010CPOL 37.3K   2  
The question: "How can I extract 5 random cards from a deck?" (or similar), appears every now and then at the C/C++ forum.I use the following method:const int CARDS = 52;int card[CARDS]; // the 'card' array represents all of the cardsint i, deck_cards;// initializationfor (i=0;...

Views

Daily Counts

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) Biotecnica Instruments S.p.A.
Italy Italy




Debugging? Klingons do not debug. Our software does not coddle the weak. Bugs are good for building character in the user.
-- The Klingon programmer



Beelzebub for his friends [^].





Comments and Discussions