C
C#8mo ago
[R3DACTED]

Need to only pick a a number Once

Greetings, I'm making a Blackjack game for a school project with a friend of mine, we used "random" to generate the numbers but we cant figure out a way to get a number only once or at least maximum of 4 times. Any suggestions ?
3 Replies
Angius
Angius8mo ago
Easiest and most reliable way would be to shuffle the array of all possible numbers, stuff it in a queue or a stack, and keep popping numbers in order
[R3DACTED]
[R3DACTED]OP8mo ago
Thank you ! I appreciate the info, really! Tho we dont really have enough time in our hands given the whole project it due tomorrow and we made the messiest possible code for the whole project (Really, it's held together by hopes and prayers) if you have time or will aswell, would you help us ?
Angius
Angius8mo ago
I mean, ask and someone might answer. Might even be me
Want results from more Discord servers?
Add your server