diff options
| author | enricotenuti <tenutz_27@outlook.it> | 2024-10-26 16:31:51 +0200 |
|---|---|---|
| committer | enricotenuti <tenutz_27@outlook.it> | 2024-10-26 16:31:51 +0200 |
| commit | aa9c690055c3a2593adbca2e1a5be0e5d421740a (patch) | |
| tree | e47b3cd222cd6585ff2870908e783e06810eb70a /src/solvers | |
| parent | 0422e6244e9e1a97397be147abb317f96d0154c3 (diff) | |
| download | nissy-core-aa9c690055c3a2593adbca2e1a5be0e5d421740a.tar.gz nissy-core-aa9c690055c3a2593adbca2e1a5be0e5d421740a.zip | |
fix solved before depth
Diffstat (limited to 'src/solvers')
| -rw-r--r-- | src/solvers/h48/solve.h | 17 | ||||
| -rw-r--r-- | src/solvers/h48/solve_multithread.h | 13 |
2 files changed, 16 insertions, 14 deletions
diff --git a/src/solvers/h48/solve.h b/src/solvers/h48/solve.h index 05b76ed..bdd09af 100644 --- a/src/solvers/h48/solve.h +++ b/src/solvers/h48/solve.h | |||
| @@ -168,16 +168,17 @@ 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 (arg->nmoves + arg->npremoves == arg->depth){ | 172 | if (issolved(arg->cube)) { |
| 173 | if(issolved(arg->cube)) { | 173 | if (arg->nmoves + arg->npremoves != arg->depth) |
| 174 | solve_h48_appendsolution(arg); | ||
| 175 | return 1; | ||
| 176 | } else { | ||
| 177 | return 0; | 174 | return 0; |
| 178 | } | 175 | solve_h48_appendsolution(arg); |
| 176 | return 1; | ||
| 179 | } | 177 | } |
| 180 | 178 | ||
| 179 | if (arg->nmoves + arg->npremoves == arg->depth) | ||
| 180 | return 0; | ||
| 181 | |||
| 181 | nextarg = *arg; | 182 | nextarg = *arg; |
| 182 | ret = 0; | 183 | ret = 0; |
| 183 | uint32_t allowed; | 184 | uint32_t allowed; |
diff --git a/src/solvers/h48/solve_multithread.h b/src/solvers/h48/solve_multithread.h index e33ed49..d7e5e43 100644 --- a/src/solvers/h48/solve_multithread.h +++ b/src/solvers/h48/solve_multithread.h | |||
| @@ -214,15 +214,16 @@ 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 (arg->nmoves + arg->npremoves == arg->depth){ | 217 | if (issolved(arg->cube)){ |
| 218 | if(issolved(arg->cube)) { | 218 | if (arg->nmoves + arg->npremoves != arg->depth) |
| 219 | solve_h48_appendsolution_thread(arg, tq); | ||
| 220 | return 1; | ||
| 221 | } else { | ||
| 222 | return 0; | 219 | return 0; |
| 223 | } | 220 | solve_h48_appendsolution_thread(arg, tq); |
| 221 | return 1; | ||
| 224 | } | 222 | } |
| 225 | 223 | ||
| 224 | if(arg->nmoves + arg->npremoves == arg->depth) | ||
| 225 | return 0; | ||
| 226 | |||
| 226 | nextarg = *arg; | 227 | nextarg = *arg; |
| 227 | ret = 0; | 228 | ret = 0; |
| 228 | uint32_t allowed; | 229 | uint32_t allowed; |
