If the move is a checking move or you have a singular reply move, extend by one ply:
Code: Select all
nch = attacked(kingpos[c^1], c^1); if (nch) ext++; // Check Extension else if (n == 1) ext++; //Singular reply extension
But there are sometimes positions where it is possible that check leads to singular reply, then again check and again singular reply and so it searches the tree very, very deep without any sense.
The tree explodes and search is stuck until timeout.
I have no good idea how to handle this problem in an elegant way. I was looking at the code of Glaurung and I didn't find anything there what would stop Glaurung's extensions, but Glaurung for sure, never has that explosion.
Any idea how to solve it elegantily?
Edit: I now saw that Glaurung extensions are mainly < One Ply, chess extension = 60/100 Ply, singular reply = 45/100 Ply... Is this the best solution? Then I would have to make fractions...