xiphos icon indicating copy to clipboard operation
xiphos copied to clipboard

draw detection

Open voyag opened this issue 5 years ago • 4 comments

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 avatar Mar 12 '19 17:03 voyag

@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).

Spill-The-Tea avatar Mar 23 '19 20:03 Spill-The-Tea

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

voyag avatar Mar 25 '19 08:03 voyag

I see, so you are proposing changing the line to read as follows, instead:

if (fifty_cnt > 100 || insufficient_material(sd->pos)) return 1;

Spill-The-Tea avatar Mar 27 '19 11:03 Spill-The-Tea

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 } } }

voyag avatar Mar 27 '19 12:03 voyag