I am coding and I came across this problem in my code, How do you create your own multidimensional array in Ruby? I tried searching up but none of the websites could help.
How do you create your own multidimensional array?
41 views Asked by AudioBubble At
1
There are no multidimentional arrays in Ruby (at least they are not first class citizens.)
One might simulate this behavior by creating an array containing arrays of the same length:
or, dynamically:
Also, there is
Matrix
class in standard library.