From: "Mehr, Assaph (Assaph)" Date: 2004-09-21T10:30:02+09:00 Subject: Re: Filling a 2D array >> @tileArray = Array.new() >> @height.times {@tileArray.push Array.new(@width, Tile.new)} > @height.times {@tileArray.push Array.new{@width, Tile.new}} Gah, posted too soon! # initialize an array of arrays: @tileArray = Array.new(@height) { Array.new } # Initizlize arrays of tiles: @height.times { @tileArray.push Array.new(@width) {Tile.new} } Comment still stands though: > As always, when you need to initialize an array with new objects per > cell (rather than references to the same object) use the block form. > You had initialized the first array correctly, but must have mistyped > for the inner array creation :-)