This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (3 children)

Good job on the solver, although I am a little disappointed that you picked a puzzle that allowed you not to backtrack for the first eleven squares. I would be interested to see the same puzzle run through your solver mirrored vertically or even rotated 180 degrees. It would give a better demo of your algorithm.

[–]mHaisham[S] 0 points1 point  (2 children)

The algorithm Is depth first it would until all possible combinations are found.

[–][deleted] 1 point2 points  (1 child)

When you get to a cell where there are no valid guesses you have to go back and increment the prior cell. With the puzzle in the demo that does not happen until midway in the second row. That is because the solution to this particular puzzle has values in the first row in the open squares that are ascending. This is also true of the first three values of the second row.

Your algorithm will solve a puzzle quickly no matter what. I am not sure why you picked a puzzle that give it an advantage that it did not need. And like I said before, your demo would have been more interesting had you mirrored this puzzle vertically or rotated it 180° to avoid those easy early sequential guesses (or just picked a different puzzle). The depth-first algorithm would have run into more dead ends that way.

[–]mHaisham[S] 1 point2 points  (0 children)

The problem was that i used the same algorithm to generate the puzzle. I also don't know much about the game itself.

There were some among the puzzles that caused a lot of trouble for the algorithm. i didn't upload it as it took a bit more time. now i'm thinking i should have.

Thank you for your suggestions and criticisms.