Yongwei Xing's base with ET
Thursday, December 10, 2009
One Pitfall when you use C# to generate the Random number
You can have try these two code snippets, see what the different.
for (int i = 0; i < 200; i++)
{
Random rand = new Random();
Console.WriteLine(rand.Next());
}
Random rand = new Random();
for (int i = 0; i < 200; i++)
{
Console.WriteLine(rand.Next());
}
No comments:
Post a Comment
‹
›
Home
View web version
No comments:
Post a Comment