This would be an interesting blog post, as the format for the state machine and logic behind it are quite fun.