fork(1) download
  1. using System;
  2. public class Test
  3. {
  4. public static void Main()
  5. {
  6. int my_seed = 100; // change my seed to whatever you want
  7. Random rand = new Random(my_seed);
  8. for (int i = 0; i < 10; i++)
  9. {
  10. rand = new Random(rand.Next());
  11. }
  12. // does this print the same number every run if we don't change the starting seed?
  13. Console.WriteLine(rand.Next()); // yes, it does
  14. }
  15. }
Success #stdin #stdout 0.03s 33912KB
stdin
1
2
10
42
11
stdout
178383625