The Random
class in Ruby 1.9.2 is guaranteed to generate random numbers in the same order, given a particular seed and range. For instance:
r = Random.new(23)
r.rand(100) # 83
r.rand(100) # 40
But suppose I want to generate the next number in the sequence on another computer (without re-generating the earlier numbers in the sequence). This should be possible, given the previous output. Is there a way to do this with the Random
class? Or do I have to write my own implementation of the Mersenne twister?