Random seeds : Math « Development « Ruby
- Ruby
- Development
- Math
Random seeds
srand(0) # Known seed
[rand(100),rand(100)] # => [44,47]: pseudorandom sequence
srand(0) # Reset the seed to repeat the sequence
[rand(100),rand(100)] # => [44,47]
Related examples in the same category