# tdumpxy.pl - Test mapping of Cell x,y to Tile tx,ty use strict; use warnings; use Organism; for my $x ( -100 .. 100 ) { for my $y ( -100 .. 100 ) { my ( $tx, $ty, $ix, $iy ) = Organism::get_tile_coords($x, $y); my ( $nx, $ny ) = Organism::get_cell_coords($tx, $ty, $ix, $iy); warn "x=$x y=$y: tx=$tx ty=$ty ix=$ix iy=$iy: nx=$nx ny=$ny\n"; $x == $nx or die "oops x"; $y == $ny or die "oops y"; } }