3 ms·
Given that possible moves for each level are discrete, does your solver work with an algorithm or by trying all possible inputs?
by xwdv 7y ago
Given that possible moves for each level are discrete, does your solver work with an algorithm or by trying all possible inputs?
- atum47 7y agoeach 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.