ogarcia / opensudoku

Open Source Sudoku game for Android.
GNU General Public License v3.0
328 stars 144 forks source link

Revert to mistake or highlight mistake #43

Closed NickEckardt closed 4 years ago

NickEckardt commented 4 years ago

I frequently work on a puzzle for a while and eventually realize I made a mistake. However, I have no way of figuring out where I made the mistake. I would like some feature that makes finding past mistakes easy so I can improve.

I see three ways to solve this: 1) Allow the user to set an option which runs the solver every time a number is placed to see if the puzzle is still solvable 2) Allow the user to manually check if the puzzle is solvable, without actually solving the puzzle. This preserves the undo stack so the user can revert back to the mistake. 3) "Revert to mistake" feature, where the app runs undo, then checks if the puzzle is solvable, until the mistake is found. Once it is found, then offending number is highlighted.

I haven't done any android development before, but I'll try implementing (2) since it's easiest. However I think (1) would be a nice feature to have.

Any other thoughts on this?

rewolff commented 4 years ago

Hard puzzles are those where some deductions are not obvious or even possible. So you have to guess, try to solve from there and backtrack if it has become unsolvable. Having the program flag the wrong move makes things much easier.

jlnordin commented 4 years ago

Pull request #59 opened to add this feature. I've added a "undo to before mistake" option that will undo until the puzzle is solvable. This is a modified version of option 3, just without the highlight. It would be possible to highlight the mistake, but it can also be useful to just know you are in a good state.

elerch commented 4 years ago

Also, PR #58 allows you to take some of those places where "deductions are not obvious" and switch to the solver on sudokuwiki.org, which shows some crazy strategies for solving puzzles. I've learned a lot by not guessing, but rather getting my current puzzle state into that solver (or companion Android app) to figure out what strategy to look for. Not the author of that site - just a fan of what was done over there.

ogarcia commented 4 years ago

Solved with #59 in 3.1.0 pubished in Play Store now :wink: