my $pos = Position->from_fen($fen);
my $hex = unpack('H*', $pos->bitpacked_fen);
print $chld_in $hex, "\n";
-my $line = <$chld_out>;
-print $line;
-chomp $line;
+chomp (my $line = <$chld_out>); # Root position hash.
+print $line, "\n";
+chomp (my $line = <$chld_out>); # Actual stats.
+print $line, "\n";
my ($white, $draw, $black, $opening_num, $white_avg_elo, $black_avg_elo, $num_elo, $timestamp, $pgn_file_number, $pgn_start_position, @moves) = split / /, $line;
# Explore one move out.
my ($np, $uci_move) = $pos->make_pretty_move($move);
my $hex = unpack('H*', $np->bitpacked_fen);
print $chld_in $hex, "\n";
- my $line = <$chld_out>;
+ my $line = <$chld_out>; # Ignore position hash.
+ $line = <$chld_out>;
print "$move $line";
}