The Perl and Raku Conference 2025: Greenville, South Carolina - June 27-29 Learn more

#!/usr/bin/perl
use strict;
use FindBin;
use lib "$FindBin::Bin/../lib";
my $board = Games::Checkers::Board->new($ENV{BOARD}, $ENV{BOARD_SIZE});
sub dump_location ($) {
my $loc = shift;
return sprintf("%02d (%s)", $loc, $board->loc_to_str($loc));
}
print "All board locations:\n";
my $iterator = Games::Checkers::LocationIterator->new($board);
my @locations = $iterator->all;
print "\t", dump_location($_), "\n" foreach @locations;