Hacker News new | past | comments | ask | show | jobs | submit login

https://chess.maxmcd.com/rnbqk3/pppp2pB/2P1p3/1P1P2Bp/3n4/b2...

very cool, made it all the way to a checkmate




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.


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.


> 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


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.


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.


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.


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.


url length limitations may thwart that, unless it's all compressed which might defeat the purpose


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...


I bring good news. It's 2024 and nobody needs to support IE any more.


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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: