- Find the first empty tile (left-right, top-down, start at top-left)
- If none are found, you’re done; otherwise, continue to step 3.
- Pretend the tile’s a voltorb
- Try and solve the rest of the board
- If the rest of the board was solved, add the solution to our list of possible solutions
- If the rest of the board was unsolvable, ignore it
- Repeat step 3 for all possible tile states (voltorb, 1, 2, and 3)
As for steps 5 and 6, when I say the board was solved, I mean it was solved correctly; that is, all the rows and columns added up to what they should have, and contained all the voltorbs they should have.
So that’s it! I’ll post again shortly, detailing some of the optimizations I made in the above algorithm, and the recommendation algorithm.
No comments:
Post a Comment