summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/plugins/sudoku/sudoku.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/apps/plugins/sudoku/sudoku.c b/apps/plugins/sudoku/sudoku.c
index b709002880..5c916f570d 100644
--- a/apps/plugins/sudoku/sudoku.c
+++ b/apps/plugins/sudoku/sudoku.c
@@ -599,6 +599,12 @@ void default_state(struct sudoku_state_t* state)
}
}
+ /* initialize the saved board so reload function works */
+ rb->memcpy(state->savedboard,state->currentboard,81);
+#ifdef SUDOKU_BUTTON_POSSIBLE
+ rb->memcpy(state->savedpossible,state->possiblevals,81);
+#endif
+
state->x=0;
state->y=0;
state->editmode=0;
@@ -1103,6 +1109,11 @@ bool sudoku_generate(struct sudoku_state_t* state)
display_board(&new_state);
rb->splash(HZ*2, "Aborted");
}
+ /* initialize the saved board so reload function works */
+ rb->memcpy(state->savedboard,state->currentboard,81);
+#ifdef SUDOKU_BUTTON_POSSIBLE
+ rb->memcpy(state->savedpossible,state->possiblevals,81);
+#endif
return res;
}