Open futer24 opened 8 years ago
Hi futer24.
Thank you very much for your input!
I did thought of shuffling the cards but I assumed this casino will have infinite number of decks in the deck to prevent card counting.
Usually, casinos have 6 decks on one table. So I think it is normal to have the same card several times. The only difference is that this game has infinite number of decks instead of 6 decks. :)
Hi
There's a problem in DeckController.cs using only the Random.Range() method; It could be the same card twice. You need to shuffle card in each round:
void Shuffle () { for (int i = 0; i < cards.Length; i++) { GameObject temp = cards[i]; int randomIndex = Random.Range(0, cards.Length); cards[i] = cards[randomIndex]; cards[randomIndex] = temp; } }
Thanks for the code and good work!