in reply to (tye)Re: 2D Arrays as a Gameboard
in thread 2D Arrays as a Gameboard
Good point, in my examples $grid, $grid1 and $grid2 store refs to the data structure not %grid....Damn sloppy. I will take the liberty of fixing the code if that's OK
I love the economy of $grid{$x,$y} to give keys like "0.-1"- very neat. Q: How much space does it save over and above the 11 unnecessary keys (121 hash keys - all in one hash in your case and in 132 in 12 hashes in mine). Or to put it another way how big is the memory penalty in setting up each extra anon hash?
Also can you explain the purpose of the preallocation? No doubt it is an efficiency measure but does it commit to a set board size? If not why do we need it as we are about to allocate values to all the keys.
cheers
tachyon
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(tye)Re2: 2D Arrays as a Gameboard
by tye (Sage) on Jun 07, 2001 at 00:00 UTC |