You could store the number(s) that have already been picked, then check whether the newly generated number equals a stored number, and if so generate another new random number and repeat that cycle until the outcome is a number that hasn't been picked yet.