}
if (exists($info->{'splicepos' . $mpv})) {
my $sp = $info->{'splicepos' . $mpv};
- if ($mate < 0) {
- return ['tb', -$sp];
+ if ($mate > 0) {
+ return ['T', $sp];
} else {
- return ['tb', $sp];
+ return ['t', $sp];
}
} else {
- return ['m', $mate];
+ if ($mate > 0) {
+ return ['M', $mate];
+ } elsif ($mate < 0) {
+ return ['m', -$mate];
+ } elsif ($pos->{'toplay'} eq 'B') {
+ return ['M', 0];
+ } else {
+ return ['m', 0];
+ }
}
} else {
if (exists($info->{'score_cp' . $mpv})) {
if (exists($info->{'splicepos' . $mpv})) {
my $sp = $info->{'splicepos' . $mpv};
if ($mate > 0) {
- return sprintf "White wins in %u/%u", int(($sp + 1) * 0.5), $sp;
+ return sprintf "White wins in %u", int(($sp + 1) * 0.5);
} else {
- return sprintf "Black wins in %u/%u", int(($sp + 1) * 0.5), $sp;
+ return sprintf "Black wins in %u", int(($sp + 1) * 0.5);
}
} else {
if ($mate > 0) {