News for hackers. Stuff that matters.
Re:Static Chess by make3 on Monday May 13, 2024 @04:58PM (#40348343)
it would be cool if the url was just the chain of the moves. then you just paste the move chain in the URL and you get the board state.
Re:Static Chess by maxmcd on Monday May 13, 2024 @05:26PM (#40348684)
huh, I originally thought this would create unusually long URLs, but if it's just the sequence of moves it could stay pretty small.

might more fun too, representing each state of play instead of just the board position.

Also easily compressible if size is an issue: https://mbuffett.com/posts/compressing-chess-moves

Would also mean all rules can be represented, and you'd be able to do cool things like highlight the previous move that was made.

Nice, ok, might try and add this.

Re:Static Chess by tromp on Tuesday May 14, 2024 @04:16AM (#40352789)
> it's just the sequence of moves it could stay pretty small.

It could also be pretty long, 5898 moves to be precise when using the 50-move rule [1].

[1] https://www.youtube.com/watch?v=D5DXJxR3Uig

Re:Static Chess by Scarblac on Monday May 13, 2024 @06:09PM (#40349107)
It uses the FEN, which is the standard notation for chess positions.

And it's the right choice, IMO -- if two positions are the same they should have the same URL, regardless of the specific move order used to reach it.

Re:Static Chess by vikingerik on Monday May 13, 2024 @09:17PM (#40350550)
The move order matters, for detecting threefold or fivefold repetition, or the 50 move draw limit.

To adhere to that properly, you need to somehow represent all previous positions that could be reached again, and the number of times it has occurred. Of course you can get that by including all the move history, but it's also possible to prune it a lot, like any capture or pawn move can flush the history since no previous position is reachable. But it's still a bit more complicated than just representing the current position.

FEN doesn't account for this, deliberately leaving the history out of scope. It's a matter of preference whether you'd want a tool like this to handle those cases.

Re:Static Chess by ummonk on Monday May 13, 2024 @09:43PM (#40350774)
No it shouldn’t. Move history has to be encoded so draw by threefold / fivefold repetition and fifty moves / seventy five moves can be claimed / detected.
Re:Static Chess by Sesse__ on Tuesday May 14, 2024 @04:08AM (#40352741)
The half-move counter in the FEN takes care of the 50/75 move rule. You do need the history if you want to implement the threefold/fivefold repetition rule, but it's rare that it is actually relevant for e.g. a chess engine's strength.
Re:Static Chess by staticfish on Monday May 13, 2024 @05:25PM (#40348669)
url length limitations may thwart that, unless it's all compressed which might defeat the purpose
Re:Static Chess by eertami on Monday May 13, 2024 @05:44PM (#40348867)
Chrome can supposedly support 32779 characters in the address bar[0], and a legal chess game should not exceed more than ~5900 moves, due to the 50 move rule. That will be enough to encode any valid game if you don't need to support IE.

[0]: https://stackoverflow.com/questions/417142/what-is-the-maxim...

Re:Static Chess by capitainenemo on Monday May 13, 2024 @07:40PM (#40349884)
Interesting. According to that stackoverflow, Chrome is one of the shortest URL lengths of the modern browsers (firefox/safari/chrome). However, it also notes you have to take CDNs and web servers and search engines into consideration, so the ginormous length limits of safari and firefox probably won't be useful any time soon.
Re:Static Chess by 6031769 on Monday May 13, 2024 @05:57PM (#40348980)
I bring good news. It's 2024 and nobody needs to support IE any more.