]> git.sesse.net Git - remoteglot/blobdiff - remoteglot.pl
More castling fixes.
[remoteglot] / remoteglot.pl
index 7bcbbdf338fd25a99b6bfcf8ec48446dd24b90b4..454cc324108dd33b77766e369b278fd846198b65 100644 (file)
@@ -23,7 +23,7 @@ $| = 1;
 my $server = "freechess.org";
 my $target = "Sesse";
 # my $engine = "/usr/games/toga2";
-my $engine = "wine rybka22-mpw32.exe";
+my $engine = "wine Rybkav2.3.2a.mp.w32.exe";
 
 open(UCILOG, ">ucilog.txt")
        or die "ucilog.txt: $!";
@@ -148,7 +148,7 @@ sub parse_infos {
                        $uciinfo{'pv'} = [ @x[1..$#x] ];
                        last;
                }
-               if ($x[0] eq 'UCI_AnalyseMode' || $x[0] eq 'setting' || $x[0] eq 'contempt') {
+               if ($x[0] eq 'string' || $x[0] eq 'UCI_AnalyseMode' || $x[0] eq 'setting' || $x[0] eq 'contempt') {
                        last;
                }
 
@@ -260,7 +260,7 @@ sub prettyprint_pv {
        }
 
        # white long castling
-       if ($pv eq 'e1b1' && $piece eq 'K') {
+       if ($pv eq 'e1c1' && $piece eq 'K') {
                my @nb = @$board;
 
                # king
@@ -269,7 +269,7 @@ sub prettyprint_pv {
                
                # rook
                substr($nb[7], 0, 1, '-');
-               substr($nb[7], 2, 1, 'R');
+               substr($nb[7], 3, 1, 'R');
                                
                return ('0-0-0', prettyprint_pv(\@nb, @pvs));
        }
@@ -290,7 +290,7 @@ sub prettyprint_pv {
        }
 
        # black long castling
-       if ($pv eq 'e8b8' && $piece eq 'k') {
+       if ($pv eq 'e8c8' && $piece eq 'k') {
                my @nb = @$board;
 
                # king
@@ -299,7 +299,7 @@ sub prettyprint_pv {
                
                # rook
                substr($nb[0], 0, 1, '-');
-               substr($nb[0], 2, 1, 'R');
+               substr($nb[0], 3, 1, 'R');
                                
                return ('0-0-0', prettyprint_pv(\@nb, @pvs));
        }