Quantcast
Channel: Answers for "unique list of 10 random numbers"
Browsing latest articles
Browse All 8 View Live

Answer by Eric5h5

You could have a list of all numbers from 0-120, then remove the ones you've already picked for the array:function Start () { var numbers = new List.<int>(121); for (i = 0; i < 121; i++) {...

View Article



Answer by IJM

Every time you are adding a new random number to your list you sould go thro all numbers in the list to see whether that number alredy exists in the list. If it exists in the list, you ask for another...

View Article

Answer by poncho

this is an other way to doit, my code suggestion would be thisvoid Start() { //having an int Array of 10 members int [] numbers = new int[10]; //using a string variable to keep record of the used...

View Article

Answer by steddyman

Recommend you take a look at Unity Random on the asset store. It has shuffle bags which would fix this. I use it for a similar scenario.

View Article
Browsing latest articles
Browse All 8 View Live




Latest Images