Unique random number generation in an integer array [duplicate]
There are several ways to solve your problem, each has its own advantages and disadvantages. First I’d like to note that you already got quite a few of responses that do the following: they generate a random number, then check somehow whether it was already used in the array, and if it was already used, … Read more