vendredi 16 septembre 2016

C# - Random number with seed

I have this code:

var rand = new Random(0);
for(int i = 1; i < 100; i++)
{
  Console.WriteLine(rand.Next(0, 100));
}

And program should give me 100 times the same number (because seed is the same), but it gives different numbers...
Why?




Aucun commentaire:

Enregistrer un commentaire