+# If there are any positions that are not accounted for by any moves,
+# these have to be games that end here. Add them as pseudo-moves so as
+# not to confuse the user.
+for my $result (['1-0', 'white', $white_left], ['1/2-1/2', 'draw', $draw_left], ['0-1', 'black', $black_left]) {
+ next if ($result->[2] == 0);
+ my $move = {
+ move => $result->[0],
+ white => 0,
+ draw => 0,
+ black => 0
+ };
+ $move->{$result->[1]} = $result->[2];
+ push @json_moves, $move;
+}
+
+# Get stats for the root position, for the human index.
+my $start_pos = Position->start_pos("white", "black");
+my ($json_start_pos, undef) = get_json_move($start_pos, 0, $chld_in, $chld_out);
+my $total_games = $json_start_pos->{'white'} + $json_start_pos->{'draw'} + $json_start_pos->{'black'};
+my $computer_games = $json_start_pos->{'computer'} * 1;
+