Oi, got that all wrong. Correct version:
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", "x"], ["x", "x", "x", "x"], ["x", "x", "x", "x"], ["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
>
On 6/3/06, Son SonOfLilit <sonoflilit@gmail.com> wrote:
>
> 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
>