View Problem

Generate a repeatable random number sequence

Initialise a random number generator with a seed and generate five decimal values. Reset the seed and produce the same values.
DiskEdit
ruby
srand(12345)
first = (1..5).collect {rand}
srand(12345)
second = (1..5).collect {rand}
puts first == second

Submit a new solution for ruby
There are 17 other solutions in additional languages (clojure, cpp, csharp, erlang ...)