From: Dave Bass Date: 2008-06-10T23:13:57+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 If you want to do this a lot, you could add your own method to the builtin Range class: class Range def random self.begin + rand(self.end - self.begin + 1) end end Then generate random numbers like this: puts (1930...1950).random (For some reason this gives "warning: (...) interpreted as grouped expression"; I don't know why. Maybe someone more experienced could explain.) -- Posted via http://www.ruby-forum.com/.