From: Steinar H. Gunderson Date: Thu, 28 Jun 2007 19:40:34 +0000 (+0200) Subject: Print more friendly mate information. X-Git-Url: https://git.sesse.net/?p=remoteglot;a=commitdiff_plain;h=a60af160df125d0e0e5ef03e52f473f1df7af030 Print more friendly mate information. --- diff --git a/remoteglot.pl b/remoteglot.pl index c960bb2..f6a9402 100755 --- a/remoteglot.pl +++ b/remoteglot.pl @@ -441,7 +441,15 @@ sub output_screen { } else { # single-PV if (defined($uciinfo{'score_mate'})) { - printf " Mate in %d\n", $uciinfo{'score_mate'}; + my $mate = $uciinfo{'score_mate'}; + if ($ficsinfo{'toplay'} eq 'B') { + $mate = -$mate; + } + if ($mate > 0) { + printf " White mates in %u\n", $mate; + } else { + printf " Black mates in %u\n", -$mate; + } } else { if (exists($uciinfo{'score_cp'})) { my $score = $uciinfo{'score_cp'} * 0.01;