for(my $x = 0; $x < $size; $x++){ for(my $y = 0; $y < $size; $y++){ print getPos($x, $y, $size)." "; } print "\n"; }