code_junkie

Pseudo Random Generator with same output

Nov 11th, 2011
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. // Provide the same seed value for both generators:
  2. System.Random r1 = new System.Random(1);
  3. System.Random r2 = new System.Random(1);
  4.  
  5. // Will output 'True'
  6. Console.WriteLine(r1.Next() == r2.Next());
  7.  
  8. nextNumber = function(seed);
  9. seed = nextNumber;
Add Comment
Please, Sign In to add comment