diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2024-09-11 17:01:49 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2024-09-11 17:01:49 +0200 |
| commit | e6ff0ce6926fa921a13055c9c35d8e60b691e776 (patch) | |
| tree | 4af98713a2b43cbd229ca081d2dac877c8c36880 /tools/020_solve_small/solve_small.c | |
| parent | dd6078288b5d7af4a4c0cdd1377a2976af569c9a (diff) | |
| download | nissy-core-e6ff0ce6926fa921a13055c9c35d8e60b691e776.tar.gz nissy-core-e6ff0ce6926fa921a13055c9c35d8e60b691e776.zip | |
Finished table refactor
Diffstat (limited to 'tools/020_solve_small/solve_small.c')
| -rw-r--r-- | tools/020_solve_small/solve_small.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/tools/020_solve_small/solve_small.c b/tools/020_solve_small/solve_small.c index dee2b55..4d07728 100644 --- a/tools/020_solve_small/solve_small.c +++ b/tools/020_solve_small/solve_small.c | |||
| @@ -20,20 +20,22 @@ void run(void) { | |||
| 20 | 20 | ||
| 21 | printf("Solved the following scrambles:\n\n"); | 21 | printf("Solved the following scrambles:\n\n"); |
| 22 | for (i = 0; scrambles[i] != NULL; i++) { | 22 | for (i = 0; scrambles[i] != NULL; i++) { |
| 23 | printf("%s\n", scrambles[i]); | 23 | printf("%d. %s\n", i+1, scrambles[i]); |
| 24 | fprintf(stderr, "Solving scramble %s\n", scrambles[i]); | 24 | fprintf(stderr, "Solving scramble %s\n", scrambles[i]); |
| 25 | if (nissy_frommoves(scrambles[i], cube) == -1) { | 25 | if (nissy_frommoves(scrambles[i], cube) == -1) { |
| 26 | fprintf(stderr, "Invalid scramble, " | 26 | fprintf(stderr, "Invalid scramble\n"); |
| 27 | "continuing with next scramble\n"); | 27 | printf("Invalid\n"); |
| 28 | continue; | 28 | continue; |
| 29 | } | 29 | } |
| 30 | n = nissy_solve( | 30 | n = nissy_solve( |
| 31 | cube, "h48", options, "", 0, 20, 1, -1, buf, sol); | 31 | cube, "h48", options, "", 0, 20, 1, -1, buf, sol); |
| 32 | if (n == 0) | 32 | if (n == 0) { |
| 33 | fprintf(stderr, "No solution found, " | 33 | printf("No solution\n"); |
| 34 | "continuing with next scramble\n"); | 34 | fprintf(stderr, "No solution found\n"); |
| 35 | } else { | ||
| 36 | printf("Solutions:\n%s\n", sol); | ||
| 37 | } | ||
| 35 | } | 38 | } |
| 36 | printf("\n"); | ||
| 37 | } | 39 | } |
| 38 | 40 | ||
| 39 | int main(void) { | 41 | int main(void) { |
