]> git.sesse.net Git - remoteglot/commitdiff
Remove obsolete book support.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 29 Dec 2020 16:53:28 +0000 (17:53 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 29 Dec 2020 16:53:28 +0000 (17:53 +0100)
remoteglot.pl

index 06549f2a53813c9969d0e960cb078cf9c32583a6..48dbf96b45aec3f843e7547d992ad4d980d1149b 100755 (executable)
@@ -858,8 +858,6 @@ sub output_screen {
                $text .= "\n\n";
        }
 
-       #$text .= book_info($pos_calculating->fen(), $pos_calculating->{'board'}, $pos_calculating->{'toplay'});
-
        my @refutation_lines = ();
        if (defined($engine2)) {
                for (my $mpv = 1; $mpv < 500; ++$mpv) {
@@ -1250,58 +1248,6 @@ sub plot_score {
        return undef;
 }
 
-my %book_cache = ();
-sub book_info {
-       my ($fen, $board, $toplay) = @_;
-
-       if (exists($book_cache{$fen})) {
-               return $book_cache{$fen};
-       }
-
-       my $ret = `./booklook $fen`;
-       return "" if ($ret =~ /Not found/ || $ret eq '');
-
-       my @moves = ();
-
-       for my $m (split /\n/, $ret) {
-               my ($move, $annotation, $win, $draw, $lose, $rating, $rating_div) = split /,/, $m;
-
-               my $pmove;
-               if ($move eq '')  {
-                       $pmove = '(current)';
-               } else {
-                       ($pmove) = prettyprint_pv_no_cache($board, $move);
-                       $pmove .= $annotation;
-               }
-
-               my $score;
-               if ($toplay eq 'W') {
-                       $score = 1.0 * $win + 0.5 * $draw + 0.0 * $lose;
-               } else {
-                       $score = 0.0 * $win + 0.5 * $draw + 1.0 * $lose;
-               }
-               my $n = $win + $draw + $lose;
-               
-               my $percent;
-               if ($n == 0) {
-                       $percent = "     ";
-               } else {
-                       $percent = sprintf "%4u%%", int(100.0 * $score / $n + 0.5);
-               }
-
-               push @moves, [ $pmove, $n, $percent, $rating ];
-       }
-
-       @moves[1..$#moves] = sort { $b->[2] cmp $a->[2] } @moves[1..$#moves];
-       
-       my $text = "Book moves:\n\n              Perf.     N     Rating\n\n";
-       for my $m (@moves) {
-               $text .= sprintf "  %-10s %s   %6u    %4s\n", $m->[0], $m->[2], $m->[1], $m->[3]
-       }
-
-       return $text;
-}
-
 sub extract_clock {
        my ($pgn, $pos) = @_;