If the current exchanges between Muller and Dr Hyatt is about this and Muller proposes any better alternative, I think he must have simply missed something or has some misunderstanding.
Long time ago, Bruce Moreland mentioned how he treated mate scores and I was surprised of how he did it. I mentioned that there was a simple way and that there seemed no need to do it in any other manner. He did no reply to my post.
The way is this:-
Code: Select all
#define infi 10000
#define max_height 128
#define loss_mate -10000 + 127
#define win_mate 10000 - 127
int search(int depth,...){
gen_moves();
if (in_check && no_valid_move){
score = -infi + ply;
hash_mate(EXACT,MAX_DEPTH, score - ply);/* adjust ply*/
return score;
}
if (probehash == true){
score = get_hash_score();
if (score <= loss_mate)
score += ply;/*adjust ply*/
if (score >= win_mate)
score -= ply;/*adjust ply*/
...etc
}
for moves{
make();
++ply;
score = -search(depth - 1, ...);
unmake();
--ply;
}
/*hash with ply adjust for mate scores */
if (score <= loss_mate){
assert(ply & 1);
assert(score - ply >= -infi);
hash_mate(EXACT,MAX_DEPTH, score - ply);
}
if (score >= win_mate){
assert(!(ply & 1));
assert(score + ply <= infi);
hash_mate(EXACT,MAX_DEPTH, score + ply);
}
return score;
}
Rasjid