$pos->{'player_b'} = $x[18];
$pos->{'player_w'} =~ s/^W?[FCIG]M//;
$pos->{'player_b'} =~ s/^W?[FCIG]M//;
$pos->{'player_b'} = $x[18];
$pos->{'player_w'} =~ s/^W?[FCIG]M//;
$pos->{'player_b'} =~ s/^W?[FCIG]M//;
$pos->{'move_num'} = $x[26];
if ($x[27] =~ /([a-h][1-8])-([a-h][1-8])/) {
$pos->{'last_move_uci'} = $1 . $2;
$pos->{'move_num'} = $x[26];
if ($x[27] =~ /([a-h][1-8])-([a-h][1-8])/) {
$pos->{'last_move_uci'} = $1 . $2;
$pos->{'last_move_uci'} = undef;
$pos->{'last_move'} = undef;
$pos->{'prettyprint_cache'} = {};
$pos->{'last_move_uci'} = undef;
$pos->{'last_move'} = undef;
$pos->{'prettyprint_cache'} = {};
my $json = { %$pos, fen => $pos->fen() };
delete $json->{'board'};
delete $json->{'prettyprint_cache'};
my $json = { %$pos, fen => $pos->fen() };
delete $json->{'board'};
delete $json->{'prettyprint_cache'};
delete $json->{'black_castle_k'};
delete $json->{'black_castle_q'};
delete $json->{'white_castle_k'};
delete $json->{'black_castle_k'};
delete $json->{'black_castle_q'};
delete $json->{'white_castle_k'};
return ($from_row, $from_col, $to_row, $to_col, $promo);
}
return ($from_row, $from_col, $to_row, $to_col, $promo);
}