print $cgi->header(-type=>'application/json');
print JSON::XS::encode_json({ moves => \@json_moves, opening => $opening, root_game => $root_game });
-sub num {
- my $x = shift;
- return $x->{'white'} + $x->{'draw'} + $x->{'black'};
-}
-
sub read_openings {
open my $fh, "../openings.txt"
or die "../openings.txt: $!";