Handle KBPPKNP better #12

wants to merge 2 commits into from

2 participants


This endgame can be a dead draw, with the same problem as KBPKN.

The code is a bit ugly... But I can't think of a nicer way to detect the one passed pawn scenario. In the case where there are no passed pawns, or both passed pawns, all bets are off for the drawiness of the position.

I'm running ELO tests right now, but I assume no ELO change. Bench is the same.

I'll flatten to the single commit if the ELO tests pan out. Or if you can think of a nicer way to write it :).


That's a good call. Once the position reaches KBPPKNP though, it's already pretty drawish. I added this in as I was watching a game where Stockfish had the advantage, and exchanged into this dead drawn endgame. Impressively, Houdini does recognize the position as a draw.

As for regular elo testing, at least it's not worse :).
Comp #1: 2059 - 1979 - 3962 (+3)
Comp #2: 1994 - 1993 - 4013 (0)

Agreed, that adding 60 lines of code for a small return is not great. I'll think on how to shorten it down. Although, stripping all the asserts would help a fair bit, that's a bit counter-productive :).

@mcostalba mcostalba closed this Aug 31, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment