diff options
Diffstat (limited to 'src/solvers/solutions.h')
| -rw-r--r-- | src/solvers/solutions.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/solvers/solutions.h b/src/solvers/solutions.h index 2340a80..75d0804 100644 --- a/src/solvers/solutions.h +++ b/src/solvers/solutions.h | |||
| @@ -1,5 +1,6 @@ | |||
| 1 | STATIC void solution_moves_reset(solution_moves_t [static 1]); | 1 | STATIC void solution_moves_reset(solution_moves_t [static 1]); |
| 2 | STATIC void solution_moves_transform(solution_moves_t [static 1], uint8_t t); | 2 | STATIC void solution_moves_transform(solution_moves_t [static 1], uint8_t); |
| 3 | STATIC void solution_moves_reorient(solution_moves_t [static 1], uint8_t); | ||
| 3 | STATIC bool solution_list_init( | 4 | STATIC bool solution_list_init( |
| 4 | solution_list_t [static 1], size_t n, char [n]); | 5 | solution_list_t [static 1], size_t n, char [n]); |
| 5 | STATIC bool solution_moves_equal( | 6 | STATIC bool solution_moves_equal( |
| @@ -35,6 +36,20 @@ solution_moves_transform(solution_moves_t moves[static 1], uint8_t t) | |||
| 35 | moves->premoves[i] = transform_move(moves->premoves[i], t); | 36 | moves->premoves[i] = transform_move(moves->premoves[i], t); |
| 36 | } | 37 | } |
| 37 | 38 | ||
| 39 | STATIC void | ||
| 40 | solution_moves_reorient(solution_moves_t moves[static 1], uint8_t or) | ||
| 41 | { | ||
| 42 | uint8_t i; | ||
| 43 | |||
| 44 | for (i = 0; i < moves->nmoves; i++) | ||
| 45 | moves->moves[i] = | ||
| 46 | inverse_reorient_move(moves->moves[i], or); | ||
| 47 | |||
| 48 | for (i = 0; i < moves->npremoves; i++) | ||
| 49 | moves->premoves[i] = | ||
| 50 | inverse_reorient_move(moves->premoves[i], or); | ||
| 51 | } | ||
| 52 | |||
| 38 | STATIC bool | 53 | STATIC bool |
| 39 | solution_list_init(solution_list_t sols[static 1], size_t n, char buf[n]) | 54 | solution_list_init(solution_list_t sols[static 1], size_t n, char buf[n]) |
| 40 | { | 55 | { |
| @@ -187,6 +202,7 @@ appendsolution( | |||
| 187 | continue; | 202 | continue; |
| 188 | } | 203 | } |
| 189 | solution_moves_transform(&tsol[r], t); | 204 | solution_moves_transform(&tsol[r], t); |
| 205 | solution_moves_reorient(&tsol[r], settings->orientation); | ||
| 190 | sortparallel_moves(tsol[r].nmoves, tsol[r].moves); | 206 | sortparallel_moves(tsol[r].nmoves, tsol[r].moves); |
| 191 | sortparallel_moves(tsol[r].npremoves, tsol[r].premoves); | 207 | sortparallel_moves(tsol[r].npremoves, tsol[r].premoves); |
| 192 | 208 | ||
