I'd actually use a single hash here to save space:
Also note that you either need to remove the "->"s from your code or change "my %grid" to "my $grid". - tye (but my friends call me "Tye")my %grid; keys %grid= 11*11; # preallocate our hash size for my $x(-5..5) { for my $y(-5..5) { $grid{$x,$y} = "co-ords x:$x, y:$y"; } }
In reply to (tye)Re: 2D Arrays as a Gameboard
by tye
in thread 2D Arrays as a Gameboard
by gregor42
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |