use v5.36; use rlib '..'; use HexGrid; use HexGrid::Path; use Carp; use Data::Dumper; my $MAP_SIZE = 3; my $grid = HexGrid->new(defaults => { style => { 'stroke-width' => 1, stroke => 'white' }, show_coords => 0}); my $region = $grid->make_region("TEST"); for (my $nw=-$MAP_SIZE; $nw <= $MAP_SIZE; $nw++) { for (my $sw=-$MAP_SIZE; $sw <= $MAP_SIZE; $sw++) { $region->make_tile_at($nw, $sw); } } $grid->make_path_from('test-id', [[0,0], [1,0], [1,1], [2,0], [2,-1], [2,-2], [1,-2], [1,-1], [2,-1], [3,-1]], colour => 'lime', css_class => 'path', style => { 'stroke-width' => 5 } ); $grid->make_path_from('point-id', [[-1,1]], colour => 'cyan', css_class => 'path', style => { 'stroke-width' => 5 } ); $grid->make_path_from('loop-id', [[-2,0], [-1,0], [-1,-1], [-2,-1], [-2,0]], colour => 'red', css_class => 'path', style => { 'stroke-width' => 5 } ); say $grid->render;