Improve identification of e.p. victim
authorH.G.Muller <hgm@hgm-xboard.(none)>
Thu, 24 Nov 2016 18:47:46 +0000 (19:47 +0100)
committerH.G.Muller <hgm@hgm-xboard.(none)>
Fri, 13 Jan 2017 15:39:23 +0000 (16:39 +0100)
commite30a78284219ac19697175114c16740c7aab850b
treeabad1963784550dcbde9084531e10837af1b62ca
parentbc82c5edb1fefc925642a5b19e4a96caa92f76e3
Improve identification of e.p. victim

The move generator now generates e.p. moves of default Pawns based on
the file of the skipped square of the previous multi-push, rather than
the e.p. rights (which were set only if ApplyMove suspects an e.p. capture
is actually possible, which might not be the case when opponent Pawns do
not capture as expected). A standard Pawn capturing to an empty square
will now always capture the previously multi-pushed Pawn. Only if there
is none it will guess where the victim should be based on FIDE rules,
and would not capture any non-Pawns in that location.
  This heuristic should work for default Pawns against any other kind
of Pawn. The existence of e.p. rights might not be recognized when
comparing positions, however, so that rep draws could be declared after
a two-fold repetition.
backend.c
common.h
moves.c