From: Robert Klemme Date: 2010-10-21T17:01:51+09:00 Subject: Re: generating random argument lists On Thu, Oct 21, 2010 at 8:11 AM, Y. NOBUOKA wrote: >> now i just want to randomly generate a random number of arrays of random >> lengths to pass as arguments to that method (each array being of >> integers 0 to 3) >> >> any suggestions? > > One way is to use the built-in function *rand*. > Here is an example program: > > arrays = Array.new > rand(10).times do >  arr = Array.new >  rand(10).times { arr << rand(4) } >  arrays << arr > end > > p arrays Or: arrays = Array.new rand 10 do Array.new(rand 5) { rand 4 } end Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/