3 ms·
each movement (left, right, top, bottom) generate a new state, the algorithm goes around searching the whole game for a "win" state
by atum47 7y ago
each movement (left, right, top, bottom) generate a new state, the algorithm goes around searching the whole game for a "win" state
- xwdv 7y agoAnd then ranks them by shortest.
- atum47 7y agoyeah, I needed a way to classify the levels by the difficulty. I should have done a double sort, one for the number of goals (boxes) and then the number of minimum moves necessary to finish the level.
- xwdv 7y agoThis is a pretty standard way of creating solvers for puzzles that have discrete states. When you are searching for a shortest solution you can also hash states to track losing paths and abandon them early.