X-Git-Url: https://git.sesse.net/?p=remoteglot-book;a=blobdiff_plain;f=www%2Fopening-stats.pl;h=c283248395aab0cf62496b2b6b66c0e99f26b6ce;hp=a17a82f067978cde4b46b033e3dbaaaa23d79d03;hb=4fa00c4fbfb86465b2d50bb0b5642f00c6b9329b;hpb=171536ef785ed241ff9b96945fd8e57082cb248a diff --git a/www/opening-stats.pl b/www/opening-stats.pl index a17a82f..c283248 100755 --- a/www/opening-stats.pl +++ b/www/opening-stats.pl @@ -23,6 +23,16 @@ print $chld_in $hex, "\n"; chomp (my $line = <$chld_out>); my ($white, $draw, $black, $opening_num, $white_avg_elo, $black_avg_elo, $num_elo, $timestamp, $pgn_file_number, $pgn_start_position, @moves) = split / /, $line; +my @json_moves = (); +push @json_moves, { + white => $white * 1, + draw => $draw * 1, + black => $black * 1, + white_avg_elo => $white_avg_elo * 1, + black_avg_elo => $black_avg_elo * 1, + num_elo => $num_elo * 1 +}; + my $opening = $openings{$opening_num} // 'A00: Start position'; my $root_game; @@ -47,7 +57,6 @@ eval { }; # Explore one move out. -my @json_moves = (); for my $move (@moves) { my ($np, $uci_move) = $pos->make_pretty_move($move); my $hex = unpack('H*', $np->bitpacked_fen);