ogarcia / opensudoku

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

Undo to checkpoint tends to lag #140

Closed polyzen closed 2 years ago

polyzen commented 2 years ago

Often when hitting Undo to checkpoint, the app is unresponsive for quite some time and the timer jumps by like 30 seconds afterwards.

ogarcia commented 2 years ago

This is completely normal behavior. The application jumps backwards step by step. If the checkpoint was created many steps ago, it may take a while to undo it. Especially if the terminal is low-end.

polyzen commented 2 years ago

The timer shouldn't reflect the amount of time this takes to process.

I don't see a redo feature, so is there a point of going step-by-step as opposed to restoring the state?

ogarcia commented 2 years ago

There is no redo option because once the system undoes it deletes the movement. You can undo step by step either by using the undo button or by using the undo option in the menu (Whether one or the other option appears depends on the screen size of your device).

Open Sudoku undo button

Open Sudoku undo menu

chrisawad commented 2 years ago

The timer shouldn't reflect the amount of time this takes to process.

I don't see a redo feature, so is there a point of going step-by-step as opposed to restoring the state?

He has a point here! When the solver or box possibilities detects an error after execution of the move, it can save the state of the board and essentially fast rewind to that moment.

It would be nice (although I think cheating) to have a feature that warns you when you make a bad move as well.

ogarcia commented 2 years ago

Checking the board every time a user makes a move to see if it is still solvable or not, requires running the solver on every move, which would negatively affect performance.

In the menu there is an option Undo to before mistake that allows you to undo to the point where you made the mistake that does not let you solve the puzzle and continue from there. Which is, in essence, the same as what you are saying. :wink: