From a0f24f0cd64695eac5ebc4f8085611698a00c8a0 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sun, 8 Jul 2007 15:10:40 +0200 Subject: [PATCH] Improve the tbhits output a bit, in particular wrt. singular form. --- remoteglot.pl | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) 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'}; -- 2.39.2