Author: Steve Maughan
Date: 12:45:12 02/12/06
Go up one level in this thread
Tord,
>Actually, I don't care much if my program occasionally announces mate
>in a wrong number of moves. As long as it doesn't announce mate
>when there is no mate, I'm happy.
Sure - no problems.
However, as promised here's Monarch's code to store distance from position.
It's so simple why not give it a try?
When storing a hash entry:
/* adjust mate score */
if (hash_score >= MAX_CHECKMATE){ // it's a winning checkmate score
hash_score += board->ply;
}
else if (hash_score <= -MAX_CHECKMATE){ // it's a losing checkmate score
hash_score -= board->ply;
}
Do the opposite when after you have probed the hash table
/* adjust mate score */
if (hash_score >= MAX_CHECKMATE){
hash_score -= board->ply;
}
else if (pv->hash_score <= -MAX_CHECKMATE){
hash_score += board->ply;
}
Regards,
Steve
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.