diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2025-07-30 16:35:25 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2025-07-30 16:35:25 +0200 |
| commit | 36c317ebd1cf1dba8a8cbec494f4d3971e6cefd3 (patch) | |
| tree | a8c28fa9c3df047a109cd617533d83d0637ead02 /src/solvers | |
| parent | 6cf7cd87a90a1314332aace1d25b9c0f230dc227 (diff) | |
| download | nissy-core-36c317ebd1cf1dba8a8cbec494f4d3971e6cefd3.tar.gz nissy-core-36c317ebd1cf1dba8a8cbec494f4d3971e6cefd3.zip | |
Fixed bug with counting solutions for coordinate solver
Diffstat (limited to 'src/solvers')
| -rw-r--r-- | src/solvers/coord/solve.h | 10 | ||||
| -rw-r--r-- | src/solvers/solutions.h | 1 |
2 files changed, 3 insertions, 8 deletions
diff --git a/src/solvers/coord/solve.h b/src/solvers/coord/solve.h index 280ca36..6ddb9dd 100644 --- a/src/solvers/coord/solve.h +++ b/src/solvers/coord/solve.h | |||
| @@ -261,8 +261,8 @@ solve_coord( | |||
| 261 | { | 261 | { |
| 262 | int8_t d; | 262 | int8_t d; |
| 263 | uint8_t t; | 263 | uint8_t t; |
| 264 | int64_t ndepth; | ||
| 265 | uint64_t i; | 264 | uint64_t i; |
| 265 | int64_t err; | ||
| 266 | cube_t c; | 266 | cube_t c; |
| 267 | const unsigned char *coord_data; | 267 | const unsigned char *coord_data; |
| 268 | const unsigned char *ptable; | 268 | const unsigned char *ptable; |
| @@ -337,12 +337,8 @@ solve_coord( | |||
| 337 | 337 | ||
| 338 | arg.target_depth = d; | 338 | arg.target_depth = d; |
| 339 | solution_moves_reset(arg.solution_moves); | 339 | solution_moves_reset(arg.solution_moves); |
| 340 | ndepth = solve_coord_dfs(&arg); | 340 | if ((err = solve_coord_dfs(&arg)) < 0) |
| 341 | 341 | return err; | |
| 342 | if (ndepth < 0) | ||
| 343 | return ndepth; | ||
| 344 | |||
| 345 | solution_list.nsols += (uint64_t)ndepth; | ||
| 346 | } | 342 | } |
| 347 | 343 | ||
| 348 | solve_coord_done: | 344 | solve_coord_done: |
diff --git a/src/solvers/solutions.h b/src/solvers/solutions.h index f3761d9..0eb3a7f 100644 --- a/src/solvers/solutions.h +++ b/src/solvers/solutions.h | |||
| @@ -255,7 +255,6 @@ solutions_done( | |||
| 255 | int8_t depth | 255 | int8_t depth |
| 256 | ) | 256 | ) |
| 257 | { | 257 | { |
| 258 | |||
| 259 | return depth > settings->maxmoves || | 258 | return depth > settings->maxmoves || |
| 260 | depth > list->shortest_sol + settings->optimal || | 259 | depth > list->shortest_sol + settings->optimal || |
| 261 | list->nsols >= settings->maxsolutions; | 260 | list->nsols >= settings->maxsolutions; |
