Code: Select all
if (false) {
} else if (my_string_equal(pgn->result,"1-0")) {
result = +1;
} else if (my_string_equal(pgn->result,"0-1")) {
result = -1; <===============
}
while (pgn_next_move(pgn,string,256)) {
if (ply < MaxPly) {
move = move_from_san(string,board);
if (move == MoveNone || !move_is_legal(move,board)) {
my_fatal("book_insert(): illegal move \"%s\" at line %d, column %d\n",string,pgn->move_line,pgn->move_column);
}
pos = find_entry(board,move);
Book->entry[pos].n++;
Book->entry[pos].sum += result+1; <========
Code: Select all
static int entry_score(const entry_t * entry) {
int score;
ASSERT(entry!=NULL);
// score = entry->n; // popularity
score = entry->sum; // "expectancy"
if (Uniform) score = 1;
ASSERT(score>=0);
return score;
}
Move selection is probably broken in the same way. It seems to make no effort to change the meaning depending on who's to move.