In Ruby, we can declare array as explain in the doc:
That makes possible many kind of use, such as:
Array.new(1, Array.new(3, Array.new(2, Array.new(1))))
=> [[[[nil], [nil]], [[nil], [nil]], [[nil], [nil]]]]
For my needs, I would like to use a code that declare an array of any
arrays that we want. I don’t know if it is possible.
If the previous example can be generated using a function like:
my_array = make_array(1, 3, 2, 1)
…this could be awesome!
Thank you for any comments and help.