diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2025-07-31 14:03:02 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2025-07-31 14:03:02 +0200 |
| commit | e201ec3b7001a2652560bfa845d41abe0bc9f181 (patch) | |
| tree | 0de76a686f20e81bb7d35abcb2549b7c9ffc686a /src/solvers/coord/solve.h | |
| parent | 474039de7af2cee7fa309e06a5c4e75b81f220ad (diff) | |
| download | nissy-core-e201ec3b7001a2652560bfa845d41abe0bc9f181.tar.gz nissy-core-e201ec3b7001a2652560bfa845d41abe0bc9f181.zip | |
Fix switch logic in coord solver
Diffstat (limited to 'src/solvers/coord/solve.h')
| -rw-r--r-- | src/solvers/coord/solve.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/solvers/coord/solve.h b/src/solvers/coord/solve.h index 9170cca..2d040de 100644 --- a/src/solvers/coord/solve.h +++ b/src/solvers/coord/solve.h | |||
| @@ -90,6 +90,10 @@ coord_continue_onnormal(const dfsarg_solve_coord_t arg[static 1]) | |||
| 90 | /* Check that we have enough moves left to switch */ | 90 | /* Check that we have enough moves left to switch */ |
| 91 | return flag & NISSY_NISSFLAG_NORMAL || nn < swbound_n; | 91 | return flag & NISSY_NISSFLAG_NORMAL || nn < swbound_n; |
| 92 | } else { | 92 | } else { |
| 93 | /* Don't switch if not allowed */ | ||
| 94 | if (!(flag & NISSY_NISSFLAG_MIXED)) | ||
| 95 | return false; | ||
| 96 | |||
| 93 | /* Forbid switching multiple times */ | 97 | /* Forbid switching multiple times */ |
| 94 | if (nn > 0) | 98 | if (nn > 0) |
| 95 | return false; | 99 | return false; |
| @@ -131,6 +135,10 @@ coord_continue_oninverse(const dfsarg_solve_coord_t arg[static 1]) | |||
| 131 | /* Check that we have enough moves left to switch */ | 135 | /* Check that we have enough moves left to switch */ |
| 132 | return flag & NISSY_NISSFLAG_INVERSE || ni < swbound_i; | 136 | return flag & NISSY_NISSFLAG_INVERSE || ni < swbound_i; |
| 133 | } else { | 137 | } else { |
| 138 | /* Don't switch if not allowed */ | ||
| 139 | if (!(flag & NISSY_NISSFLAG_MIXED)) | ||
| 140 | return false; | ||
| 141 | |||
| 134 | /* Forbid switching multiple times */ | 142 | /* Forbid switching multiple times */ |
| 135 | if (ni > 0) | 143 | if (ni > 0) |
| 136 | return false; | 144 | return false; |
