diff options
| author | enricotenuti <tenutz_27@outlook.it> | 2024-10-26 16:08:17 +0200 |
|---|---|---|
| committer | enricotenuti <tenutz_27@outlook.it> | 2024-10-26 16:08:17 +0200 |
| commit | 0422e6244e9e1a97397be147abb317f96d0154c3 (patch) | |
| tree | 3a3abd8cce12ccc0bcb38f1c32213af2647dcf04 /src | |
| parent | 09fb2900d3811d76ef145e5f960e5b824bb0bfb6 (diff) | |
| download | nissy-core-0422e6244e9e1a97397be147abb317f96d0154c3.tar.gz nissy-core-0422e6244e9e1a97397be147abb317f96d0154c3.zip | |
Check depth fix
Diffstat (limited to '')
| -rw-r--r-- | src/solvers/h48/solve.h | 14 | ||||
| -rw-r--r-- | src/solvers/h48/solve_multithread.h | 10 |
2 files changed, 14 insertions, 10 deletions
diff --git a/src/solvers/h48/solve.h b/src/solvers/h48/solve.h index d506596..05b76ed 100644 --- a/src/solvers/h48/solve.h +++ b/src/solvers/h48/solve.h | |||
| @@ -168,14 +168,16 @@ solve_h48_dfs(dfsarg_solveh48_t *arg) | |||
| 168 | 168 | ||
| 169 | if (solve_h48_stop(arg)) | 169 | if (solve_h48_stop(arg)) |
| 170 | return 0; | 170 | return 0; |
| 171 | 171 | ||
| 172 | if (issolved(arg->cube)) { | 172 | if (arg->nmoves + arg->npremoves == arg->depth){ |
| 173 | if (arg->nmoves + arg->npremoves != arg->depth) | 173 | if(issolved(arg->cube)) { |
| 174 | solve_h48_appendsolution(arg); | ||
| 175 | return 1; | ||
| 176 | } else { | ||
| 174 | return 0; | 177 | return 0; |
| 175 | solve_h48_appendsolution(arg); | 178 | } |
| 176 | return 1; | ||
| 177 | } | 179 | } |
| 178 | 180 | ||
| 179 | nextarg = *arg; | 181 | nextarg = *arg; |
| 180 | ret = 0; | 182 | ret = 0; |
| 181 | uint32_t allowed; | 183 | uint32_t allowed; |
diff --git a/src/solvers/h48/solve_multithread.h b/src/solvers/h48/solve_multithread.h index 72f519e..e33ed49 100644 --- a/src/solvers/h48/solve_multithread.h +++ b/src/solvers/h48/solve_multithread.h | |||
| @@ -214,11 +214,13 @@ solve_h48_single(dfsarg_solveh48_t *arg, task_queue_t *tq) | |||
| 214 | if (solve_h48_stop(arg)) | 214 | if (solve_h48_stop(arg)) |
| 215 | return 0; | 215 | return 0; |
| 216 | 216 | ||
| 217 | if (issolved(arg->cube)){ | 217 | if (arg->nmoves + arg->npremoves == arg->depth){ |
| 218 | if (arg->nmoves + arg->npremoves != arg->depth) | 218 | if(issolved(arg->cube)) { |
| 219 | solve_h48_appendsolution_thread(arg, tq); | ||
| 220 | return 1; | ||
| 221 | } else { | ||
| 219 | return 0; | 222 | return 0; |
| 220 | solve_h48_appendsolution_thread(arg, tq); | 223 | } |
| 221 | return 1; | ||
| 222 | } | 224 | } |
| 223 | 225 | ||
| 224 | nextarg = *arg; | 226 | nextarg = *arg; |
