News for hackers. Stuff that matters.
Re:I benchmarked 8 different ways of representing a 2d grid ... by gindevine on Friday December 31, 2010 @09:36AM (#2055457)
When creating a 2d grid array with all values the same, slicing one row multiple times works way faster than creating each row for each column.

   for(var y=h;y>=0; y--) row.push(0);
   for(var x=w; x>=0; x--) grid[x] = row.slice(0);
It seems to me that this method should work without any problems, but I may be wrong..

There are no comments on this comment yet.