Originally posted by ZlaireYou can stop that by scoring mate in one slightly higher than mate in 2 and so on, which is going to be easiest to implement by scoring checkmate as (327 + ply_depth_of_search) pawns and subtracting 1 (adding 1) to the score if it is over 326 (beneath -326) just before you return from the alpha-beta function, this way the function treats quicker checkmates as better scoring. Alternatively start iterative deepening from 1 ply.
One common problem with chess engines not being able to mate is they don't recognize that a mate in 1 move is better than a mate in 3 moves.
As long as the mate is within the horizon it can't see the difference between the mates, so it just moves back and forth.
I'll put a in a post about that when I get to the evaluation part.
Originally posted by ZlaireExcellent ...I've always wanted to know how to start creating a chess engine, so good on ya mate, I'll be looking forward to this post and your blog!
I've decided to rewrite my chess engine from scratch (more or less), and since blogging is so popular these days I decided to write about my progress.
From scratch to the engine beating me. Let's see if I can do it.
Feel free to drop by and point out all the errors I'm making.