Kyle Schmitt wrote:
> When trying to append to an array that lives in an array, it appends
> to all until the individual array is used with =
> 
> Here's exactly what I did
> 
> irb(main):007:0> a=Array.new(9,Array.new())
> I expect and I get [[], [], [], [], [], [], [], [], []]

You probably also expect those nine arrows to be nine different empty arrays
(the result of calling Array.new nine times), but that is not the case.
Array.new is called exactly once and a[0] to a[8] point to the empty array
resulting from that.
So naturally if you change one of the arrays, you change them all, because
they're all the same array.
If you however replace one of the arrays with another array, the rest aren't
affected.
I hope I explained this right and helped you understand.


-- 
NP: Kreator - Carrion
Ist so, weil ist so
Bleibt so, weil war so