3 ms·
actually the final position is given by the type of figure - queen, king, etc. - and they have limited positions possible (not all 64) - even queen would have a
by malkia 6y ago
actually the final position is given by the type of figure - queen, king, etc. - and they have limited positions possible (not all 64) - even queen would have at the best - how many? like 27-28 possible - so 16+28 bits only now per move, and it can go lower. Replaying these moves should be almost instant (not much really)
- malkia 6y agoeven further - since the first part says what figure is moved, based on the current state - it can tell what are the possible states (in bits), and only expect that amount of bits that follow. - at the end it'll be just bag of bytes, that need to be URL encoded. Probably something that can fit in a long URL (max 2048 chars?)
- recursivecaveat 6y agoYou can get under one byte per move actually. There are less than 256 moves possible from any given chess position, so you just have an algorithm to order them, and index into that. You can do even better with variable length compression and move ordering. Here's a post from lichess about their system: https://lichess.org/blog/Wqa7GiAAAOIpBLoY/developer-update-275-improved-game-compression https://lichess.org/blog/Wqa7GiAAAOIpBLoY/developer-update-2...