I decided to store positions as FENs, and started to wonder, what's the maximum FEN string length?

For now I came up with 77 symbols:

Now I wonder how much more symbols can be added via castling & en passant possibilities?

For now I came up with 77 symbols:

1n1q1b1r/1r1b1k1n/1p1p1p1p/p1p1p1p1/1P1P1P1P/P1P1P1P1/1R1B1K1N/1N1Q1B1R w - -

Now I wonder how much more symbols can be added via castling & en passant possibilities?

1n1q1b1r/1r1b1k1n/1p1p1p1p/p1p1p1p1/1P1P1P1P/P1P1P1P1/1R1B1K1N/1N1Q1B1R w KQkq f3 12 127

is that the upper bound for the longest possible FEN? of course en passant and castling is not right, but if you would change the position so that it's possible the position string would be a bit shorter ;)

That's what I meant, right. How to get maximum possible FEN according to rules? I intentionally left off the trailing values, but I think you can get at least around 1200th move, not 127.

ok, yes, in theory you could also get over 1200 moves maybe :) at least you have to consider cases where noone claims the 50 moves rule and so on. but that's quite hypothetic :)

No, I meant according to 50 moves rule too: the pawns advanced 24 squares, so if we separate each pawn move with 49 other, we get 1200.

Ah, yes, and you can't get '12' if the en passant capture is possible, only '0'.

ok, so one of those entries has to be "-"

Maybe that's the longest "realistic" legal one

r1n1k1b1/1r1b1q1n/1p1p1p1p/p1p1p1p1/1P1P1P1P/P1P1P1P1/1R1B1Q1N/R1N1K1B1 w Qq - 12 1270

He-he, it isn't legal though: you've got 2 same-colored bishops on both sides :)

r1n1k1B1/1r1b1q1n/1p1p1p1p/p1p1p1p1/1P1P1P1P/P1P1P1P1/1R1B1Q1N/R1N1K1b1 w Qq - 12 1000

better? :)

You can probably set up a Fischerandom position where all castling moves are possible.

ah, that's right, so the maximum is 2 chars longer :)

r1n1k1r1/1B1b1q1n/1p1p1p1p/p1p1p1p1/1P1P1P1P/P1P1P1P1/1b1B1Q1N/R1N1K1R1 w KQkq - 12 1000

The PGN standard mentions the length of FEN strings, saying that they can become over 80 characters. Yours is 88, which must be the longest FEN string, unless you allow a 3 digit halfmove clock or over 999 moves. The length of a Fischerandom FEN is the same as for regular chess so this should be sufficient for that too.

Of course I just typed 100 and forgot about it: it's now interesting from a completely academic point of view :)

> unless you allow a 3 digit halfmove clock

Is there a reason not to? It's perfectly legal at the end of the game even if 50-move draws are enforced.

> Is there a reason not to?

None that I can think of unless you have some very unusual requirements.

Powered by mwForum 2.27.4 © 1999-2012 Markus Wichitill