Not logged inRybka Chess Community Forum
Up Topic The Rybka Lounge / Computer Chess / Riddle: maximum length of FEN string
- - By Zruty (*****) Date 2008-12-01 14:21
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:
1n1q1b1r/1r1b1k1n/1p1p1p1p/p1p1p1p1/1P1P1P1P/P1P1P1P1/1R1B1K1N/1N1Q1B1R w - -


Now I wonder how much more symbols can be added via castling & en passant possibilities?
Parent - - By Felix Kling (Gold) Date 2008-12-01 14:26 Edited 2008-12-01 14:29
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 ;)
Parent - - By Zruty (*****) Date 2008-12-01 14:32
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.
Parent - - By Felix Kling (Gold) Date 2008-12-01 14:34
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 :)
Parent - By Zruty (*****) Date 2008-12-01 14:35
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.
Parent - - By Zruty (*****) Date 2008-12-01 14:34
Ah, yes, and you can't get '12' if the en passant capture is possible, only '0'.
Parent - By Felix Kling (Gold) Date 2008-12-01 14:40
ok, so one of those entries has to be "-"
Parent - - By Felix Kling (Gold) Date 2008-12-01 14:42
Maybe that's the longest "realistic" legal one
r1n1k1b1/1r1b1q1n/1p1p1p1p/p1p1p1p1/1P1P1P1P/P1P1P1P1/1R1B1Q1N/R1N1K1B1 w Qq - 12 1270
Parent - - By Zruty (*****) Date 2008-12-01 14:43
He-he, it isn't legal though: you've got 2 same-colored bishops on both sides :)
Parent - - By Felix Kling (Gold) Date 2008-12-01 14:44 Edited 2008-12-01 14:49
r1n1k1B1/1r1b1q1n/1p1p1p1p/p1p1p1p1/1P1P1P1P/P1P1P1P1/1R1B1Q1N/R1N1K1b1 w Qq - 12 1000


better? :)
Parent - - By Dadi Jonsson (Silver) Date 2008-12-01 14:49
You can probably set up a Fischerandom position where all castling moves are possible.
Parent - By Felix Kling (Gold) Date 2008-12-01 14:49
ah, that's right, so the maximum is 2 chars longer :)

r1n1k1r1/1B1b1q1n/1p1p1p1p/p1p1p1p1/1P1P1P1P/P1P1P1P1/1b1B1Q1N/R1N1K1R1 w KQkq - 12 1000
Parent - - By Dadi Jonsson (Silver) Date 2008-12-01 14:38 Edited 2008-12-01 15:01
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.
Parent - By Zruty (*****) Date 2008-12-01 14:42
Of course I just typed 100 and forgot about it: it's now interesting from a completely academic point of view :)
Parent - - By Vempele (Silver) Date 2008-12-01 15:26

> 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.
Parent - By Dadi Jonsson (Silver) Date 2008-12-01 15:53

> Is there a reason not to?


None that I can think of unless you have some very unusual requirements.
Up Topic The Rybka Lounge / Computer Chess / Riddle: maximum length of FEN string

Powered by mwForum 2.27.4 © 1999-2012 Markus Wichitill