]> git.sesse.net Git - remoteglot-book/commitdiff
Fix a sort-of rare and silly castling bug.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 12 Dec 2014 01:16:12 +0000 (02:16 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 12 Dec 2014 01:16:12 +0000 (02:16 +0100)
www/opening-stats.pl

index b62a30b605a23b787c00f5e4bf919bf852fb0c16..f9e85484eb0ca749df78fbd604b9a10a7f748319 100755 (executable)
@@ -19,7 +19,7 @@ my $fen = $cgi->param('fen') // 'rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w K
 my $pos = Position->from_fen($fen);
 my $hex = unpack('H*', $pos->bitpacked_fen);
 print $chld_in $hex, "\n";
-my $line = <$chld_out>;
+chomp (my $line = <$chld_out>);
 
 my ($white, $draw, $black, $opening_num, $white_avg_elo, $black_avg_elo, $num_elo, $timestamp, @moves) = split / /, $line;
 my $opening = $openings{$opening_num} // 'A00: Start position';