voom Posted December 2, 2003 Posted December 2, 2003 I am making a blackjack game and I have all the cards stored in an array. How can I randomize the array so that when crads are dealt it is random. Will there be problems drawing the same card twice? Thanks in Advance Quote
*Experts* mutant Posted December 2, 2003 *Experts* Posted December 2, 2003 How are you making the cards different? Do you have some kind of an enumeration with all possible kinds or what? If you have an enumaration, it would the easiest way to do, using the Random object. Quote
*Experts* Bucky Posted December 2, 2003 *Experts* Posted December 2, 2003 Check out wyrd's card games for guidance on shuffling your cards. The Deck class has a Shuffle method that you can look at. It basically just loops through every card and swaps the current card in the loop with a random one. Quote "Being grown up isn't half as fun as growing up These are the best days of our lives" -The Ataris, In This Diary
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.