diff options
Diffstat (limited to 'tools/solvetest.h')
| -rw-r--r-- | tools/solvetest.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/solvetest.h b/tools/solvetest.h index 4c72ca5..75f7aab 100644 --- a/tools/solvetest.h +++ b/tools/solvetest.h | |||
| @@ -95,23 +95,24 @@ void run(void) { | |||
| 95 | for (i = 0; s[i].scramble[0]; i++) { | 95 | for (i = 0; s[i].scramble[0]; i++) { |
| 96 | printf("\n%d. %s\n", i, s[i].scramble); | 96 | printf("\n%d. %s\n", i, s[i].scramble); |
| 97 | 97 | ||
| 98 | /* Multiple solutions */ | ||
| 99 | if (nissy_applymoves(NISSY_SOLVED_CUBE, s[i].scramble, cube) | 98 | if (nissy_applymoves(NISSY_SOLVED_CUBE, s[i].scramble, cube) |
| 100 | == -1) { | 99 | == NISSY_ERROR_INVALID_MOVES) { |
| 101 | printf("Invalid scramble\n"); | 100 | printf("Invalid scramble\n"); |
| 102 | continue; | 101 | exit(1); |
| 103 | } | 102 | } |
| 103 | |||
| 104 | nissy_solve(cube, solver, | 104 | nissy_solve(cube, solver, |
| 105 | NISSFLAG, MINMOVES, MAXMOVES, MAXSOLUTIONS, OPTIMAL, | 105 | NISSFLAG, MINMOVES, MAXMOVES, MAXSOLUTIONS, OPTIMAL, |
| 106 | 0, size, buf, SOL_BUFFER_LEN, sol, stats, | 106 | 0, size, buf, SOL_BUFFER_LEN, sol, stats, |
| 107 | NULL, NULL); | 107 | NULL, NULL); |
| 108 | |||
| 108 | if (check_all(sol, s[i].solutions)) { | 109 | if (check_all(sol, s[i].solutions)) { |
| 109 | printf("All solutions are correct\n"); | 110 | printf("All solutions are correct\n"); |
| 110 | } else { | 111 | } else { |
| 111 | printf("Error!\n"); | 112 | printf("Error!\n"); |
| 112 | printf("Found solution(s):\n%s", sol); | 113 | printf("Found solution(s):\n%s", sol); |
| 113 | printf("Valid solution(s):\n%s", s[i].solutions); | 114 | printf("Valid solution(s):\n%s", s[i].solutions); |
| 114 | return; | 115 | exit(1); |
| 115 | } | 116 | } |
| 116 | } | 117 | } |
| 117 | 118 | ||
