\r
if (move != MoveNone &&\r
move_is_legal(move,board) &&\r
- score/10>option_get_int(Option,"BookTreshold")) {\r
+ score>10*option_get_int(Option,"BookTreshold")) {\r
\r
// pick this move?\r
\r
if (entry->key != board->key) break;\r
\r
move = entry->move;\r
- score = (entry->count*10000)/sum; // 32 bit safe!\r
+ score = (((uint32)entry->count)*((uint32)10000))/sum; // 32 bit safe!\r
\r
- if (score > 0 && move != MoveNone && move_is_legal(move,board)) {\r
- list_add_ex(list,move,score);\r
+ if (move != MoveNone && move_is_legal(move,board)) {\r
+ list_add_ex(list,move,score);\r
}\r
}\r
\r
char move_string[256];\r
list_t list[1];\r
int i;\r
+ int treshold=option_get_int(Option,"BookTreshold");\r
\r
ASSERT(board!=NULL);\r
\r
\r
for(i=0; i<list_size(list); i++){\r
move_to_san(list->move[i],board,move_string,256);\r
- printf(" %6s %5.2f%%\n",move_string,list->value[i]/100.0);\r
+ if(list->value[i]>10*treshold){\r
+ printf(" %6s %5.2f%%\n",move_string,list->value[i]/100.0);\r
+ }else{\r
+ printf(" %6s %5.2f%% (below treshold %4.2f%%)\n",\r
+ move_string,list->value[i]/100.0,treshold/10.0);\r
+ }\r
}\r
+ // this is necessary by the xboard protocol\r
+ printf("\n");\r
}\r
\r
// book_learn_move()\r