Comment faire pour produire des nombres aléatoires dans une fourchette ?
Vous pouvez essayer
Random r = new Random();
int rInt = r.Next(0, 100); //for ints
int range = 100;
double rDouble = r.NextDouble()* range; //for doubles
Regardez sur
[Classe Random][1], méthode Random.Next (Int32, Int32)][2] et méthode Random.NextDouble ][3].
[1] : http://msdn.microsoft.com/en-us/library/system.random.aspx [2] : http://msdn.microsoft.com/en-us/library/2dx6wyd4.aspx [3] : http://msdn.microsoft.com/en-us/library/system.random.nextdouble.aspx