From a60af160df125d0e0e5ef03e52f473f1df7af030 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Thu, 28 Jun 2007 21:40:34 +0200 Subject: [PATCH] Print more friendly mate information. --- remoteglot.pl | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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; -- 2.39.2