- Home /
Shuffle a deck for a card game
Hello, I have some problems making a card game. I have an array of cards, but I dont know how to take this cards without repeat someone.
I try random.range(0,array.lenght), and then check if this number is in another array of selected numbers. But I thinkg there is a better method, help please
Answer by Graham-Dunnett · May 13, 2015 at 11:01 AM
So, you have an array of cards. Loop 100 times. Inside each loop choose two random numbers between 0 and 51. Then swap those two entries.
Your answer
Follow this Question
Related Questions
Random Tag Call Script [C#] 3 Answers
How do I shuffle a list and reset it back to the previous ordering later? 1 Answer
Cards: Stacking, drawing, hand, and shuffling 1 Answer
Does the Unity Webplayer Plugin run on a laptop without a graphics adapter expansion card? 1 Answer
Creating a multiplayer poker game - one server per table ? 0 Answers