diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2024-12-15 16:55:01 +0100 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2024-12-15 17:21:49 +0100 |
| commit | 99b746a01c11e061c4bd42cf096d27be9507ae21 (patch) | |
| tree | a373a1930a987d5146b8a66abc993ce8a3c4644b /src/solvers | |
| parent | de70dc746f16607e2110f2c6acee8ed8ba2507f8 (diff) | |
| download | nissy-core-99b746a01c11e061c4bd42cf096d27be9507ae21.tar.gz nissy-core-99b746a01c11e061c4bd42cf096d27be9507ae21.zip | |
Fix rare bug, but one more bug to go
Diffstat (limited to 'src/solvers')
| -rw-r--r-- | src/solvers/h48/solve.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/solvers/h48/solve.h b/src/solvers/h48/solve.h index c415370..9f0cb78 100644 --- a/src/solvers/h48/solve.h +++ b/src/solvers/h48/solve.h | |||
| @@ -78,6 +78,9 @@ solve_h48_appendsolution(dfsarg_solve_h48_t *arg) | |||
| 78 | 78 | ||
| 79 | invertmoves(arg->premoves, arg->npremoves, arg->moves + arg->nmoves); | 79 | invertmoves(arg->premoves, arg->npremoves, arg->moves + arg->nmoves); |
| 80 | 80 | ||
| 81 | /* Sort parallel moves for consistency */ | ||
| 82 | sortparallel(arg->moves, arg->nmoves + arg->npremoves); | ||
| 83 | |||
| 81 | /* Do not append the solution in case premoves cancel with normal */ | 84 | /* Do not append the solution in case premoves cancel with normal */ |
| 82 | if (arg->npremoves > 0 && !allowednextmove(arg->moves, arg->nmoves+1)) | 85 | if (arg->npremoves > 0 && !allowednextmove(arg->moves, arg->nmoves+1)) |
| 83 | return 0; | 86 | return 0; |
| @@ -106,10 +109,7 @@ solve_h48_appendallsym(dfsarg_solve_h48_t *arg) | |||
| 106 | all[j][i] = transform_move(arg->moves[i], t); | 109 | all[j][i] = transform_move(arg->moves[i], t); |
| 107 | 110 | ||
| 108 | /* Sort parallel moves for consistency */ | 111 | /* Sort parallel moves for consistency */ |
| 109 | for (i = 0; i < n - 1; i++) | 112 | sortparallel(all[j], n); |
| 110 | if (moveaxis(all[j][i]) == moveaxis(all[j][i+1]) && | ||
| 111 | movebase(all[j][i]) == movebase(all[j][i+1]) + 1) | ||
| 112 | SWAP(all[j][i], all[j][i+1]); | ||
| 113 | 113 | ||
| 114 | /* Check for duplicate solutions */ | 114 | /* Check for duplicate solutions */ |
| 115 | for (k = 0; k < j; k++) { | 115 | for (k = 0; k < j; k++) { |
