M
Mark
Is the code below impacted by the computer that it is executed on, or would
one expect two computers that use the same seed to generate the same
numbers? For example, I executed the code below on two different computers
and got the same set of numbers on both machines repeatedly.
Coments? Thanks in advance.
Random number = new Random( 5 );
Random number2 = new Random( 5 );
for ( int i = 0; i < 10 ; i++)
{
Console.Out.WriteLine("Random1: " + number.Next(0 , 100).ToString());
Console.Out.WriteLine("Random2: " + number2.Next(0 , 100).ToString());
}
Thanks in advance.
Mark
one expect two computers that use the same seed to generate the same
numbers? For example, I executed the code below on two different computers
and got the same set of numbers on both machines repeatedly.
Coments? Thanks in advance.
Random number = new Random( 5 );
Random number2 = new Random( 5 );
for ( int i = 0; i < 10 ; i++)
{
Console.Out.WriteLine("Random1: " + number.Next(0 , 100).ToString());
Console.Out.WriteLine("Random2: " + number2.Next(0 , 100).ToString());
}
Thanks in advance.
Mark