I misunderstand Array behaviour
When i created this matrix
matrix, cell = [], []; 5.times { cell << [] } # columns
3.times { matrix << cell } # lines
matrix
sample_data = (0..5).to_a
matrix[1][2] = sample_data.clone
matrix.each { |line| puts "line : #{line}" }
I have this result
line : [[], [], [0, 1, 2, 3, 4, 5], [], []]
line : [[], [], [0, 1, 2, 3, 4, 5], [], []]
line : [[], [], [0, 1, 2, 3, 4, 5], [], []]
Instead the expected result
line : [[], [], [], [], []]
line : [[], [], [0, 1, 2, 3, 4, 5], [], []]
line : [[], [], [], [], []]
What wrong ?