my $from_col = defined($2) ? _col_letter_to_num($2) : undef;
my $from_row = defined($3) ? _row_letter_to_num($3) : undef;
my $from_col = defined($2) ? _col_letter_to_num($2) : undef;
my $from_row = defined($3) ? _row_letter_to_num($3) : undef;
my ($to_row, $to_col) = _square_to_pos($4);
# Find all possible from-squares that could have been meant.
my @squares = ();
my $side = 'K';
if ($toplay eq 'B') {
my ($to_row, $to_col) = _square_to_pos($4);
# Find all possible from-squares that could have been meant.
my @squares = ();
my $side = 'K';
if ($toplay eq 'B') {
$side = 'k';
}
for my $row (0..7) {
next if (defined($from_row) && $from_row != $row);
for my $col (0..7) {
next if (defined($from_col) && $from_col != $col);
$side = 'k';
}
for my $row (0..7) {
next if (defined($from_row) && $from_row != $row);
for my $col (0..7) {
next if (defined($from_col) && $from_col != $col);