Sven Schüle wrote:I'm glad to read that my intuition was right. As to your new example, it is correct that now there aren't any repetitions possible. As you have shown by yourself, castling flags are still relevant: the same position could be reached via a path where White had already moved the king and/or rook forth and back and then Black played Qe2+ (or Qxe2+). And that other position would be different from the one you gave just for the missing castling right, which would be important not in the context of repetition detection but of correct hash key setting. [...]
It is clear that black played Qxe2+ and not Qe2+ without a capture(otherwise castling cannot be in the FEN)
In case that Qe2+ is the last move of black it means that the last move of white before Qe2+ was Ke1 or Rh1 and white cannot castle.
The position is legal only because it is possible that white play a move like Bf1-e2 or Qd1-e2 and black replied Qxe2+
Uri
No, you missed my point here. I thought the other way round: the same position as given by Richard but *without* the castling right may be reached after the white king and/or white rook have already moved forth and back, and in that case the last move of black may have been either Qe2+ or Qxe2+. Qe2+ would have been possible, too, since the castling right was already gone for white.
while that is true, the following is also true. The following snippets are all legal and identical, except that a character string match will fail:
8/4n3/...
8/22n3/...
8/1111n111/...
etc.
The idea is to provide something like SAN, which is pretty well defined, to produce the shortest (but consistent) move representation,
rather than the ugly long algebraic stuff like e2e4 and such.
..but i like my coordinate notation.
An EP target when no EP is possible makes little sense to me.
Yes, agreed. I don't like the idea of a EP target move in a FEN. Rather it should be a special character within the FEN to determine if the advanced pawn is able to en passant.
* astricks look like a simple solution to all the problems.
without the astrisk there would be no EP move possible.
Just add a check for '*' in your FEN reader/writer and you'd be fine.
Just add '*' if last side to move was a pawn move advanced 2 spaces, passing any enemy pawns left/right. This doesn't have to be anything different then say a check (+) symbol would be done after a move. Like in displaying the PV lines...
example:
rnbqkbnr/p1p1pppp/1p6/3pP3/8/8/PPPP1PPP/RNBQKBNR w KQkq d6 0 3
would be written:
rnbqkbnr/p1p1pppp/1p6/3pP*3/8/8/PPPP1PPP/RNBQKBNR w KQkq 0 3
This would tell the chess program that e5* has the opportunity to en passant on the next move, so make sure to look for en passant in your search.
Pretty simple.
while that is an OK idea, I would mark the pawn that can be captured with an *, rather than the capturing pawn, since there can be two of these in a position, one on either side of the pawn that just advanced 2 squares.
I still think it would be better to mark the empty square(s) passed by the Pawn that can be aptured. That would work in any variant. In Berolina Chess, knowing which Pawn can be e.p. captured could still leave ambiguity as to which Pawn can capture. E.g:
[d] 4k3/8/8/2pPpP2/8/8/8/4K3 w
Both d5xd6 and f5xf6 could be e.p. captures of Pe5, depending on if the previous move was c7-e5 or g7-e5. Similarly, if you know that Pd5 can e.p. capture by d5xd6, it could either capture Pc5 or Pe5, depending on if the previous move was e7-c5 or c7-e5, respectively.
hgm wrote:I still think it would be better to mark the empty square(s) passed by the Pawn that can be aptured. That would work in any variant. In Berolina Chess, knowing which Pawn can be e.p. captured could still leave ambiguity as to which Pawn can capture. E.g:
[d] 4k3/8/8/2pPpP2/8/8/8/4K3 w
Both d5xd6 and f5xf6 could be e.p. captures of Pe5, depending on if the previous move was c7-e5 or g7-e5. Similarly, if you know that Pd5 can e.p. capture by d5xd6, it could either capture Pc5 or Pe5, depending on if the previous move was e7-c5 or c7-e5, respectively.
A simpler alternative, why not just mark the source square for the piece of the side not on move so that the last move can be determined? That handles every case I would think unless there are some games with odd/snakey pawn double/triple moves that might be able to go thru a path where an EP is possible or not possible, although I hardly know much about non-real-chess games myself.
In Berolina Chess that could give ambiguity in the following position:
[d] 4k3/8/8/2pP1Pp1/8/8/8/4K3 w
where e7 is marked, because both Pc5 and Pg5 could have come from e7, and could then be e.p. captured by d5xd6 or f5xf6, respectively.
But it is certainly a good idea to use this for disambiguation, in combination with marking the e.p square itself. So mark both e7 and d6 if the last Pawn move was e7-c5 (i.e. use the FEN 4k3/4*3/3*4/2pP1Pp1/8/8/8/4K3 w).
By the very definition of e.p. capture, the square where you can e.p. capture to is empty, and the square you came from is also always empty. So you only need to mark empty squares.
hgm wrote:In Berolina Chess that could give ambiguity in the following position:
[d] 4k3/8/8/2pP1Pp1/8/8/8/4K3 w
where e7 is marked, because both Pc5 and Pg5 could have come from e7, and could then be e.p. captured by d5xd6 or f5xf6, respectively.
But it is certainly a good idea to use this for disambiguation, in combination with marking the e.p square itself. So mark both e7 and d6 if the last Pawn move was e7-c5 (i.e. use the FEN 4k3/4*3/3*4/2pP1Pp1/8/8/8/4K3 w).
By the very definition of e.p. capture, the square where you can e.p. capture to is empty, and the square you came from is also always empty. So you only need to mark empty squares.