jeudi 14 avril 2016

Random value without duplicates

Random r = new Random();
int randomvalue = r.Next(1,20);
*
*
if(randomvalue == 1) something
if(randomvalue == 2) something
*
*
if(randomvalue == 19) something

What is the best way to make that randomvalue without repeat? Btw: Its WPF, not console.




Aucun commentaire:

Enregistrer un commentaire