From: Boris Schmid Date: 2008-05-26T17:45:57+09:00 Subject: briefest method of generating a list of random numbers? Hi all, I wondered if there was a more compact method of generating things like a random string, or a random list of numbers than I'm using now (using ruby 1.9.0-1) array = [] ; 100.times {array << rand} string = "" ; 100.times {string << (rand(26) + 97).chr} The temptation is to use array = [rand] * 100 string = (rand(26) + 97).chr * 100 but that only draws one random number a 100 times. Is there a bit of syntax that I missed? -- Posted via http://www.ruby-forum.com/.