add comment regarding our choice of the FEN spec for en passant threats

Tue, 08 Sep 2026 13:55:48 +0200

author
Mike Becker <universe@uap-core.de>
date
Tue, 08 Sep 2026 13:55:48 +0200
changeset 223
e2519b3dd5e7
parent 222
6388f9340a09
child 224
93e0e89496fe

add comment regarding our choice of the FEN spec for en passant threats

src/chess/fen.c file | annotate | diff | comparison | revisions
--- a/src/chess/fen.c	Mon Sep 07 17:01:21 2026 +0200
+++ b/src/chess/fen.c	Tue Sep 08 13:55:48 2026 +0200
@@ -90,7 +90,15 @@
 }
 
 static size_t fen_enpassant(char *str, const GameState *gamestate) {
-
+    /* We use the old specification where the en passant threat is always
+     * noted, regardless of a possible capture. This specification is also
+     * used by chess.com, for example. There is a modernized specification,
+     * which states that the threat is only to be noted when there is a valid
+     * capturing move for the active color (lichess.org uses this version of
+     * the specification). But this is unnecessarily complicated and as long
+     * as the old spec is still valid and commonly used, we implement the easy
+     * version.
+     */
     str[0] = '-';
 
     for (int file = 0 ; file < 8 ; file++) {
@@ -306,4 +314,4 @@
     }
 
     return 0;
-}
\ No newline at end of file
+}

mercurial