]> git.sesse.net Git - remoteglot/blobdiff - remoteglot.pl
Print more friendly mate information.
[remoteglot] / remoteglot.pl
index 84e7af71425161e3c8ed3eab4ac4f6bdcc1e59ab..f6a94028ef2d4ac1d65705f20ed08261bd86b46d 100755 (executable)
@@ -52,7 +52,7 @@ while (<UCIREAD>) {
 
 uciprint("setoption name UCI_AnalyseMode value true");
 uciprint("setoption name NalimovPath value c:\\nalimov");
-uciprint("setoption name NalimovUsage value Normally");
+uciprint("setoption name NalimovUsage value Rarely");
 uciprint("setoption name Hash value 1024");
 # uciprint("setoption name MultiPV value 3");
 # uciprint("setoption name Contempt value 1000");
@@ -304,7 +304,7 @@ sub prettyprint_pv {
                
                # rook
                substr($nb[0], 7, 1, '-');
-               substr($nb[0], 5, 1, 'R');
+               substr($nb[0], 5, 1, 'r');
                                
                return ('0-0', prettyprint_pv(\@nb, @pvs));
        }
@@ -319,7 +319,7 @@ sub prettyprint_pv {
                
                # rook
                substr($nb[0], 0, 1, '-');
-               substr($nb[0], 3, 1, 'R');
+               substr($nb[0], 3, 1, 'r');
                                
                return ('0-0-0', prettyprint_pv(\@nb, @pvs));
        }
@@ -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;