}
$np->{'player_w'} = $pos->{'player_w'};
$np->{'player_b'} = $pos->{'player_b'};
+ if (exists($pos->{'start_fen'})) {
+ $np->{'start_fen'} = $pos->{'start_fen'};
+ }
+ if (exists($pos->{'chess960'})) {
+ $np->{'chess960'} = $pos->{'chess960'};
+ }
if (defined($pretty_move)) {
$np->{'last_move'} = $pretty_move;
} else {
return ($pos, $uci_move);
}
+sub is_chess960 {
+ my ($pos) = shift;
+ return (defined($pos->{'chess960'}) && $pos->{'chess960'});
+}
+
sub _pos_to_square {
my ($row, $col) = @_;
return sprintf("%c%d", ord('a') + $col, 8 - $row);