xiphos
xiphos copied to clipboard
draw detection
In search.c in the function draw() at line 78 it returns draw if the fifty move counter is >=100 but is not always true because with fifty move counter = 100 there could also be a checkmate.
@voyag, you want that to occur. Even if there is a checkmate after the 50 move rule, it is still a draw (and is known as a cursed win).
No you are wrong, if the fifty move counter = 100 you have to see if there is a checkmate. if so is a win else it is a draw
I see, so you are proposing changing the line to read as follows, instead:
if (fifty_cnt > 100 || insufficient_material(sd->pos)) return 1;
it's not so simple, it should be something like this:
if (fity_cnt==100) { if(!InCheck) return 1 else { generate_evasions if (at least a legal move) return 1 else { it's checkmate and the search should return a checkmate score } } }