Solver for 1024 game