From: Steinar H. Gunderson Date: Sun, 8 Jul 2007 13:10:40 +0000 (+0200) Subject: Improve the tbhits output a bit, in particular wrt. singular form. X-Git-Url: https://git.sesse.net/?p=remoteglot;a=commitdiff_plain;h=a0f24f0cd64695eac5ebc4f8085611698a00c8a0 Improve the tbhits output a bit, in particular wrt. singular form. --- diff --git a/remoteglot.pl b/remoteglot.pl index b36487d..16a4f8d 100755 --- a/remoteglot.pl +++ b/remoteglot.pl @@ -610,8 +610,12 @@ sub output_screen { $text .= " ($score)" if (defined($score)); my $tbhits = ''; - if (exists($uciinfo{'tbhits' . $mpv})) { - $tbhits = sprintf ", %u tbhits", $uciinfo{'tbhits' . $mpv}; + if (exists($uciinfo{'tbhits' . $mpv}) && $uciinfo{'tbhits' . $mpv} > 0) { + if ($uciinfo{'tbhits' . $mpv} == 1) { + $tbhits = ", 1 tbhit"; + } else { + $tbhits = sprintf ", %u tbhits", $uciinfo{'tbhits' . $mpv}; + } } if (exists($uciinfo{'nodes' . $mpv}) && exists($uciinfo{'nps' . $mpv}) && exists($uciinfo{'depth' . $mpv})) { @@ -635,8 +639,12 @@ sub output_screen { $text .= sprintf " %u nodes, %7u nodes/sec, depth %u ply", $uciinfo{'nodes'}, $uciinfo{'nps'}, $uciinfo{'depth'}; } - if (exists($uciinfo{'tbhits'})) { - $text .= sprintf ", %u Nalimov hits", $uciinfo{'tbhits'}; + if (exists($uciinfo{'tbhits'}) && $uciinfo{'tbhits'} > 0) { + if ($uciinfo{'tbhits'} == 1) { + $text .= ", one Nalimov hit"; + } else { + $text .= sprintf ", %u Nalimov hits", $uciinfo{'tbhits'}; + } } if (exists($uciinfo{'seldepth'})) { $text .= sprintf " (%u selective)", $uciinfo{'seldepth'};