Live data from Hacker News

Static Chess

val.town

51–60 of 127 posts

Re: Static Chess

#52
I did something nearly identical to this for the board game Reversi as part of an exercise to teach myself Python, except the opponent was always a simple minimax search-based AI. This was back in 2006, though, so I suppose doing it without JavaScript and putting all of the state into the URL was a lot more obvious of an approach back then compared to today. :)

Re: Static Chess

#54
post #22

Earlier quoted context omitted.

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

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

#55

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

Re: Static Chess

#56

I was hoping this was going to be a chess variant where you're not allowed to move any of the pieces.

Me too. In the meantime, check out Go for a similar but more static game (more googleable by it's Chinese name Weiqi or its Korean name Baduk).

"go game" works great for search too.

Re: Static Chess

#58
post #11

Learned about https://fav.farm and https://val.town from this. Neat resources!

https://fav.farm seems like a cool service at first, but it doesn't actually do a whole lot. I'd just assume inline the one-liner they mention (similar to https://css-tricks.com/emoji-as-a-favicon/) and avoid the external dependency for the price of 117 characters.
Post reply on HN