# create a function that generates an array of numbers num_gen = proc do |count| (0...count).to_a end # create a function that generates an array of strings string_gen = proc do |count| max = ('a'[0] + count).chr ('a'...max).to_a end # use the generators without knowing what they are generators = [ num_gen, string_gen ] generators.each do |gen| puts "[#{gen.call(5).join(', ')}]" end