Fun fact: you can use this to play chess960 (i.e. fischer random chess), or any other "custom start position" variant, just by appending a FEN to the URL (replace spaces with underscores).
Example: https://chess.maxmcd.com/bbnqrknr/pppppppp/8/8/8/8/PPPPPPPP/...
Chess960 also has different castling rules from normal chess though, and the site can't know it should use those just from the FEN?
The main difference is that the FEN no longer only encodes castling to the king's or queen's side. It must fully encode which file for each side. Castling _rules_ are the same, just the castling _location_ can change.
https://www.chessprogramming.org/Forsyth-Edwards_Notation#Ch...
I admit that while I do regularly play chess, I'm not super well versed in either FEN nor Chess960. That said, I've been trying to figure out why you would need a different notation for Chess960 for half an hour now, and I just can't figure it out. All explanations I'm seeing just make some vague mention about ambiguity in the regular notation for Chess960, but I, personally, can't think of a situation in which the regular notation is insufficient.
The KQkq still unambiguously mark which player can castle to which side, and once either a rook or King move for the first time, you just remove the corresponding letter(s). What am I missing?
One of the rooks might move over to the other side during the course of the game, and then it's no longer unambiguous which one is the castling rook.
E.g., if you have your king on e1, a rook on f1 and another one on g1… can you castle if the f1 rook moves? Can you castle if the g1 rook moves? Just “kingside” won't tell you the difference.
I mean technically it still isn’t ambiguous because you could just refer to the starting position to see which rook is allowed to move.
Which of course is annoying to implement, but you do already have to keep state on the history of the game to determine if moves are legal, e.g. you can’t castle twice.
You don't have the starting position
The entire point of a FEN is that it describes the entire board state without having to know anything about the history.
No, that's what the castling rights field in the FEN is for. Once you castle, you zero out both the k and q bits.
the king always has to be in between rooks in chess960
As a starting position, sure.
But if you have a later board state, with two rooks on one side: how do you know which one is still eligible to castle?
Ah, that's the possibility I wasn't thinking of. Thank you.
That depends - Chess960 doesn't have different castling rules from normal chess, it just has additional considerations that normal chess does not.
In other words, Chess960's castling rules are completely consistent with normal chess castling rules, so depending on how it is implemented, it might just work.
It depends on how exactly you define it. If the standard rule is as commonly taught "king moves two spaces and the rook hops over", 960 isn't the same. If the rule is "king moves to c or g file, rook moves to d or f", then it is the same. Those rules are equivalent for standard chess but only the latter ports to 960 properly. (We're probably agreeing, in that's what you mean by depending on the implementation, I'm just spelling it out.)
Indeed - perhaps you could say that 960's castling rules are a superset of normal castling rules.
Edit: Actually, I think the other way around is more accurate - 960's castling rules are a subset of normal castling rules.