From: Daniel Schierbeck Date: 2006-07-28T00:25:11+09:00 Subject: Re: rand(-10..10) Marc Heiler wrote: > "the first is by far more obvious." > > I think it looks ugly. :-) > > (-10..10).rand > looks much nicer IMHO. This should work with all enumerables: module Enumerable def rand entries = entries entries.at(Kernel.rand(entries.length)) end end I can't seem to get around the `entries = entries' part -- I don't want to convert the enumerable to an array more than once. Any ideas? Cheers, Daniel