Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Funny, I was just working on this same thing last week. I ended up using 16 bits per move. As other comments here note, you could do it in fewer bits, but everything is a trade-off: with speed, size, and what the goal of your compression is. For me, fixed-size, two bytes per move seems good.

Also, I don't bother with storing capture, or check, because those you can infer from the game state. Again, depends on how you be using the result - I just wanted to be able to re-play the game state.



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

Search: