diff options
Diffstat (limited to 'src/solvers')
| -rw-r--r-- | src/solvers/h48/solve.h | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/src/solvers/h48/solve.h b/src/solvers/h48/solve.h index ed06a85..bbe59e5 100644 --- a/src/solvers/h48/solve.h +++ b/src/solvers/h48/solve.h | |||
| @@ -29,8 +29,7 @@ typedef struct { | |||
| 29 | _static void solve_h48_appendsolution(dfsarg_solveh48_t *); | 29 | _static void solve_h48_appendsolution(dfsarg_solveh48_t *); |
| 30 | _static_inline bool solve_h48_stop(dfsarg_solveh48_t *); | 30 | _static_inline bool solve_h48_stop(dfsarg_solveh48_t *); |
| 31 | _static int64_t solve_h48_dfs(dfsarg_solveh48_t *); | 31 | _static int64_t solve_h48_dfs(dfsarg_solveh48_t *); |
| 32 | _static int64_t solve_h48( | 32 | _static int64_t solve_h48(cube_t, int8_t, int8_t, int8_t, uint8_t, uint8_t, const void *, char *); |
| 33 | cube_t, int8_t, int8_t, int8_t, uint8_t, uint8_t, const void *, char *); | ||
| 34 | 33 | ||
| 35 | _static int64_t solve_h48stats_dfs(dfsarg_solveh48stats_t *); | 34 | _static int64_t solve_h48stats_dfs(dfsarg_solveh48stats_t *); |
| 36 | _static int64_t solve_h48stats(cube_t, int8_t, const void *, char [static 12]); | 35 | _static int64_t solve_h48stats(cube_t, int8_t, const void *, char [static 12]); |
| @@ -38,26 +37,26 @@ _static int64_t solve_h48stats(cube_t, int8_t, const void *, char [static 12]); | |||
| 38 | _static void | 37 | _static void |
| 39 | solve_h48_appendsolution(dfsarg_solveh48_t *arg) | 38 | solve_h48_appendsolution(dfsarg_solveh48_t *arg) |
| 40 | { | 39 | { |
| 41 | int strl; | 40 | int strl; |
| 42 | char *solution = *arg->nextsol; | 41 | char *solution = *arg->nextsol; |
| 43 | 42 | ||
| 44 | strl = writemoves(arg->moves, arg->nmoves, *arg->nextsol); | 43 | strl = writemoves(arg->moves, arg->nmoves, *arg->nextsol); |
| 45 | *arg->nextsol += strl; | 44 | *arg->nextsol += strl; |
| 46 | 45 | ||
| 47 | if (arg->npremoves) { | 46 | if (arg->npremoves) { |
| 48 | **arg->nextsol = ' '; | 47 | **arg->nextsol = ' '; |
| 49 | (*arg->nextsol)++; | 48 | (*arg->nextsol)++; |
| 50 | 49 | ||
| 51 | uint8_t* invertedpremoves = invertpremoves(arg->premoves, arg->npremoves); | 50 | uint8_t* invertedpremoves = invertpremoves(arg->premoves, arg->npremoves); |
| 52 | strl = writemoves(invertedpremoves, arg->npremoves, *arg->nextsol); | 51 | strl = writemoves(invertedpremoves, arg->npremoves, *arg->nextsol); |
| 53 | free(invertedpremoves); | 52 | free(invertedpremoves); |
| 54 | *arg->nextsol += strl; | 53 | *arg->nextsol += strl; |
| 55 | } | 54 | } |
| 56 | LOG("Solution found: %s\n", solution); | 55 | LOG("Solution found: %s\n", solution); |
| 57 | 56 | ||
| 58 | **arg->nextsol = '\n'; | 57 | **arg->nextsol = '\n'; |
| 59 | (*arg->nextsol)++; | 58 | (*arg->nextsol)++; |
| 60 | (*arg->nsols)++; | 59 | (*arg->nsols)++; |
| 61 | } | 60 | } |
| 62 | 61 | ||
| 63 | _static_inline bool | 62 | _static_inline bool |
