From: Son SonOfLilit Date: 2006-06-03T22:17:08+09:00 Subject: []= and two dimensional arrays ------=_Part_16197_30831404.1149340624218 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline I expect: irb(main):002:0> a = Array.new.fill(Array.new.fill("x", 0, 4), 0, 4) => [["x", "x", "x", "x"], ["x", "x", "x", "x"], ["x", "x", "x", "x"], ["x", "x", "x", "x"]] irb(main):003:0> p a [["x", "x", "x", "x"], ["x", "x", "x", "x"], ["x", "x", "x", "x"], ["x", "x", "x", "x"]] => nil irb(main):004:0> a[2][3] = "a" => "a" irb(main):005:0> p a [["x", "x", "x", "a"], ["x", "x", "x", "a"], ["x", "x", "x", "a"], ["x", "x", "x", "a"]] => nil irb(main):006:0> ======================== I get: irb(main):002:0> a = Array.new.fill(Array.new.fill("x", 0, 4), 0, 4) => [["x", "x", "x", "x"], ["x", "x", "x", "x"], ["x", "x", "x", "x"], ["x", "x", "x", "x"]] irb(main):003:0> p a [["x", "x", "x", "x"], ["x", "x", "x", "x"], ["x", "x", "x", "x"], ["x", "x", "x ", "x"]] => nil irb(main):004:0> a[2][3] = "a" => "a" irb(main):005:0> p a [["x", "x", "x", "a"], ["x", "x", "x", "a"], ["x", "x", "x", "a"], ["x", "x", "x ", "a"]] => nil ========================= I spend hours debugging and when I find it out, I have no clue how to solve it. Could somebody clue me as to a solution? Thanks, SonOfLilit ------=_Part_16197_30831404.1149340624218--