where FEN is not consistent

Discussion of chess software programming and technical issues.

Moderator: Ras

bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: where FEN is not consistent

Post by bob »

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.
Jeez, what a strange game. :)
jhaglund
Posts: 173
Joined: Sun May 11, 2008 7:43 am

Re: where FEN is not consistent

Post by jhaglund »

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.

Okay, now I see your dilema. Capturing left or right.

As a chess player, right away, you will see that the Pawn is advanced and white's turn. You'll want to know if there is EP available for white.

Easy, have 2 special characters.

{ or < - left brace for left capture
} or > - right brace for right capture

It points to the direction it captures also, logical.

rnbqkbnr/p1p1pppp/1p6/3pP{3/8/8/PPPP1PPP/RNBQKBNR w KQkq 0 3

Okay you can start implementing ;)