From: Tim Hunter Date: 2008-06-10T10:35:16+09:00 Subject: Re: Random Number Stuff David Stanislaus wrote: > How would you create a random number generator thats limited to a > specific rang? say > > 1930 - 1950 > > Thanks Observe that Kernel#rand accepts an argument. If present and not 0, then rand returns numbers >= 0.0 and < the argument. So x = rand(20) will always return a number n such that 0.0 <= n < 20. All you have to do is add 1930 to it: x = 1930 + rand(20) -- RMagick: http://rmagick.rubyforge.org/ RMagick 2: http://rmagick.rubyforge.org/rmagick2.html