diff options
author | Paul Duncan <pabs@pablotron.org> | 2019-01-15 01:00:20 -0500 |
---|---|---|
committer | Paul Duncan <pabs@pablotron.org> | 2019-01-15 01:00:20 -0500 |
commit | 914ca426630ccadcbb6f1ff02a599bdaf10b6cb2 (patch) | |
tree | ff29a33f306efc56f805b576674729ea7e5064d7 /src/test-solve | |
parent | dec30a82819f93903004a3e9d46bf22f352942b4 (diff) | |
download | sok-914ca426630ccadcbb6f1ff02a599bdaf10b6cb2.tar.bz2 sok-914ca426630ccadcbb6f1ff02a599bdaf10b6cb2.zip |
s/test-solve/solve/
Diffstat (limited to 'src/test-solve')
-rw-r--r-- | src/test-solve/main.c | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/src/test-solve/main.c b/src/test-solve/main.c deleted file mode 100644 index 2a9ed53..0000000 --- a/src/test-solve/main.c +++ /dev/null @@ -1,41 +0,0 @@ -#include <stdbool.h> // bool -#include <string.h> // atoi() -#include <stdlib.h> // EXIT_{FAILURE,SUCCESS} -#include <stdio.h> -#include "../libsok/sok.h" -#include "../text/util.h" -#include "../text/levels.h" - -static void -solve_on_error( - const char * const err -) { - die("Error solving level: %s", err); -} - -int main(int argc, char *argv[]) { - // init context - sok_ctx_t ctx; - sok_ctx_init(&ctx, NULL); - - // walk levels - for (int i = 1; i < argc; i++) { - const size_t level_num = atoi(argv[i]); - - // get level - const level_t *level = levels_get_level(level_num); - - // load level - if (!sok_ctx_set_level(&ctx, level->data)) { - die("Couldn't load level %d", (int) level_num); - } - - // solve level - if (!sok_solve(&ctx, solve_on_error)) { - die("Couldn't solve level"); - } - } - - // return success - return EXIT_SUCCESS; -} |