On not leaving the King in check

Discussion of chess software programming and technical issues.

Moderator: Ras

jwes
Posts: 778
Joined: Sat Jul 01, 2006 7:11 am

Re: On not leaving the King in check

Post by jwes »

mcostalba wrote:
Fguy64 wrote:
mcostalba wrote:
Fguy64 wrote: My suggestion involves searching positions in which the king is in check. Thus one of the "legal" replies will be capturing the king, and when that move is searched, the first thing that happens is that the next occurrence of alphaBeta() will say Hey! this guy has no king, and return an extreme eval without considering any replies.
What if THAT move is the fourth or fifth tried on that node ?

The position is illegal (because opponent king is under check) but you don't know it. Then, for instance, generate captures and start try them and after 4-5 moves you finally generate the king capture and discover position is illegal.

I would say really too late, you have spent time searching moves possibly at big depth for nothing.
Well, I did end up doing move ordering so that any king captures are evaluated first, if that makes a difference.
Also before TT move ?
If you don't store illegal positions in the TT, there is no problem.