if (bpfen.empty()) {
break;
}
+ string prev_pos_hash = read_hex_line(stdin);
- int bucket = hash_key_to_bucket(bpfen.data(), bpfen.size(), num_buckets);
+ string searchkey = bpfen + prev_pos_hash;
+ int bucket = hash_key_to_bucket(searchkey.data(), searchkey.size(), num_buckets);
if (mtbls[bucket] == NULL) {
char filename[256];
snprintf(filename, sizeof(filename), "%s.part%04d", argv[1], bucket);
uint16_t board_hash = util::Hash32(bpfen.data(), bpfen.size());
printf("%d\n", board_hash);
- mtbl_iter *it = mtbl_source_get_prefix(srcs[bucket], (const uint8_t *)bpfen.data(), bpfen.size());
+ mtbl_iter *it = mtbl_source_get_prefix(srcs[bucket], (const uint8_t *)searchkey.data(), searchkey.size());
const uint8_t *key, *val;
size_t len_key, len_val;
}
if (has_c) {
- printf("%d %d %d %u %ld %ld %d %ld %d %ld",
- c.white(), c.draw(), c.black(), c.opening_num(),
- c.sum_white_elo(),
- c.sum_black_elo(),
+ printf("%d %d %d %d %u %ld %ld %d %ld %d %ld",
+ c.white(), c.draw(), c.black(), c.computer(),
+ c.opening_num(), c.sum_white_elo(), c.sum_black_elo(),
c.num_elo(), c.first_timestamp(),
c.pgn_file_num(),
c.pgn_start_position());