}
# white long castling
- if ($pv eq 'e1b1' && $piece eq 'K') {
+ if ($pv eq 'e1c1' && $piece eq 'K') {
my @nb = @$board;
# king
# rook
substr($nb[7], 0, 1, '-');
- substr($nb[7], 2, 1, 'R');
+ substr($nb[7], 3, 1, 'R');
return ('0-0-0', prettyprint_pv(\@nb, @pvs));
}
}
# black long castling
- if ($pv eq 'e8b8' && $piece eq 'k') {
+ if ($pv eq 'e8c8' && $piece eq 'k') {
my @nb = @$board;
# king
# rook
substr($nb[0], 0, 1, '-');
- substr($nb[0], 2, 1, 'R');
+ substr($nb[0], 3, 1, 'R');
return ('0-0-0', prettyprint_pv(\@nb, @pvs));
}
if (defined($uciinfo{'score_mate'})) {
printf " Mate in %d\n", $uciinfo{'score_mate'};
} else {
- my $score = $uciinfo{'score_cp'} * 0.01;
- if ($ficsinfo{'toplay'} eq 'B') {
- $score = -$score;
+ if (exists($uciinfo{'score_cp'})) {
+ my $score = $uciinfo{'score_cp'} * 0.01;
+ if ($ficsinfo{'toplay'} eq 'B') {
+ $score = -$score;
+ }
+ printf " Score: %+5.2f\n", $score;
}
- printf " Score: %+5.2f\n", $score;
}
- print " PV: ", join(', ', prettyprint_pv($ficsinfo{'board'}, @{$uciinfo{'pv'}}));
- print "\n";
- printf " %u nodes, %7u nodes/sec, depth %u ply",
- $uciinfo{'nodes'}, $uciinfo{'nps'}, $uciinfo{'depth'};
+
+ if (exists($ficsinfo{'board'})) {
+ print " PV: ", join(', ', prettyprint_pv($ficsinfo{'board'}, @{$uciinfo{'pv'}}));
+ print "\n";
+ }
+
+ if (exists($uciinfo{'nodes'}) && exists($uciinfo{'nps'}) && exists($uciinfo{'depth'})) {
+ printf " %u nodes, %7u nodes/sec, depth %u ply",
+ $uciinfo{'nodes'}, $uciinfo{'nps'}, $uciinfo{'depth'};
+ }
if (exists($uciinfo{'tbhits'})) {
printf ", %u Nalimov hits", $uciinfo{'tbhits'};
}