]> git.sesse.net Git - remoteglot/blobdiff - remoteglot.pl
Add some dark mode CSS, for the latest fads.
[remoteglot] / remoteglot.pl
index 7220412d14a03e022d7c50f9f8e6abf096a15e98..9d611c0e6cfe2700cc0f8a5118f36b2e318b72fa 100755 (executable)
@@ -535,10 +535,14 @@ sub prettyprint_pv_no_cache {
                return ();
        }
 
-       my $pv = shift @pvs;
-       my ($from_row, $from_col, $to_row, $to_col, $promo) = parse_uci_move($pv);
-       my ($pretty, $nb) = $board->prettyprint_move($from_row, $from_col, $to_row, $to_col, $promo);
-       return ( $pretty, prettyprint_pv_no_cache($nb, @pvs) );
+       my @ret = ();
+       for my $pv (@pvs) {
+               my ($from_row, $from_col, $to_row, $to_col, $promo) = parse_uci_move($pv);
+               my ($pretty, $nb) = $board->prettyprint_move($from_row, $from_col, $to_row, $to_col, $promo);
+               push @ret, $pretty;
+               $board = $nb;
+       }
+       return @ret;
 }
 
 sub prettyprint_pv {
@@ -585,13 +589,13 @@ sub complete_using_tbprobe {
                        $pos = $pos->make_move(parse_uci_move($move));
                }
 
-               while ($pos->num_pieces() > 6 && $#pv > -1) {
+               while ($pos->num_pieces() > 7 && $#pv > -1) {
                        my $move = shift @pv;
                        push @moves, $move;
                        $pos = $pos->make_move(parse_uci_move($move));
                }
 
-               return if ($pos->num_pieces() > 6);
+               return if ($pos->num_pieces() > 7);
 
                my $fen = $pos->fen();
                my $pgn_text = `fathom --path=/srv/syzygy "$fen"`;
@@ -603,6 +607,9 @@ sub complete_using_tbprobe {
                # Splice the PV from the tablebase onto what we have so far.
                for my $move (@{$pgn->moves}) {
                        last if $move eq '#';
+                       last if $move eq '1-0';
+                       last if $move eq '0-1';
+                       last if $move eq '1/2-1/2';
                        my $uci_move;
                        ($pos, $uci_move) = $pos->make_pretty_move($move);
                        push @moves, $uci_move;