Good Math Puzzle . I've know some of your pattern before XD.
I think you need to add checkpoint into your game.
Thanks!