diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/text/action.c | 2 | ||||
-rw-r--r-- | src/text/action.h | 1 | ||||
-rw-r--r-- | src/text/main.c | 7 |
3 files changed, 10 insertions, 0 deletions
diff --git a/src/text/action.c b/src/text/action.c index 3d63bce..3381c0a 100644 --- a/src/text/action.c +++ b/src/text/action.c @@ -56,6 +56,8 @@ get_action(void) { .type = ACTION_WARP, .data = atoi(buf), }; + case 'r': + return (action_t) { .type = ACTION_RESET }; case 's': return (action_t) { .type = ACTION_SOLVE }; default: diff --git a/src/text/action.h b/src/text/action.h index d77b3ef..77f0e9c 100644 --- a/src/text/action.h +++ b/src/text/action.h @@ -11,6 +11,7 @@ typedef enum { ACTION_UNDO, ACTION_NEXT, ACTION_SOLVE, + ACTION_RESET, ACTION_LAST, } action_type_t; diff --git a/src/text/main.c b/src/text/main.c index db4a48c..7d6f144 100644 --- a/src/text/main.c +++ b/src/text/main.c @@ -82,6 +82,13 @@ int main(int argc, char *argv[]) { } break; + case ACTION_RESET: + // reset level + if (!sok_ctx_set_level(&ctx, level->data)) { + die("Couldn't load level %zu", level_num); + } + + break; case ACTION_WARP: level_num = action.data; level = levels_get_level(level_num); |