Last Updated: February 25, 2016
·
427
· hidakatsuya

Generate a random numbers of N length in Ruby

Array.new(N){proc{rand(9)+1}}.map(&:call).join #=> "12345..N"