Join multidimensional array elements with a Ruby oneliner
Just the code
matrix = Array[
[1, 2, 3],
[4, 5, 6],
[0, 0, 0]
]
puts matrix[0..1].transpose.map {|col| col.join(', ')}.join(', ')
>>> 1, 4, 2, 5, 3, 6
I thought of this because of canvas.setTransform()