I am trying to iterate an array with multiple dimensions created with the following line
To continue, I use the following code
visiblematrix= Array.new (10) {Array.new(10){0}}
But this does not allow me to know the current position of x, y during the iteration. how can I find this without resorting to temporary variables.
visiblematrix.each do |x| x.each do |y| puts y end end
source share