X-Git-Url: https://git.sesse.net/?p=remoteglot;a=blobdiff_plain;f=remoteglot.pl;h=b9055a64d30616ff945bed8fd59c500ab8eeb62c;hp=9742a5a09a8686e93270290961ac4fa3704a2dae;hb=23c6ef78cb21c7dac5a6a43c8f3c2875efa76891;hpb=6d612018059e2e69f3ac39657d667e438c83782d diff --git a/remoteglot.pl b/remoteglot.pl index 9742a5a..b9055a6 100755 --- a/remoteglot.pl +++ b/remoteglot.pl @@ -1180,13 +1180,21 @@ sub score_digest { } 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})) { @@ -1216,9 +1224,9 @@ sub long_score { 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) {