diff options
| author | Sebastiano Tronto <sebastiano.tronto@gmail.com> | 2020-07-27 15:29:13 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano.tronto@gmail.com> | 2020-07-27 15:29:13 +0200 |
| commit | 5ca725cdd08814791bd57f30e5066d63cc7babc1 (patch) | |
| tree | 92571859af06def82368d78dfa22121a0db992c9 | |
| parent | 40352f018b29e8aea9a804dd1240ea8374c39db8 (diff) | |
| download | nissy-5ca725cdd08814791bd57f30e5066d63cc7babc1.tar.gz nissy-5ca725cdd08814791bd57f30e5066d63cc7babc1.zip | |
Fixed a bug with NISS
Diffstat (limited to '')
| -rw-r--r-- | .gitignore | 2 | ||||
| -rwxr-xr-x | nissy | bin | 520584 -> 171912 bytes | |||
| -rw-r--r-- | src/solver.c | 8 |
3 files changed, 8 insertions, 2 deletions
| @@ -1,3 +1,3 @@ | |||
| 1 | backup | 1 | backup |
| 2 | src/dbg_compile.sh | 2 | dbg_compile.sh |
| 3 | TODO | 3 | TODO |
| Binary files differ | |||
diff --git a/src/solver.c b/src/solver.c index c61aec4..497ef04 100644 --- a/src/solver.c +++ b/src/solver.c | |||
| @@ -66,6 +66,8 @@ void niss_eo_dfs(int eo, int scramble[], int eo_list[][30], int *eo_count, | |||
| 66 | } | 66 | } |
| 67 | } | 67 | } |
| 68 | 68 | ||
| 69 | if (*eo_count >= m) | ||
| 70 | return; | ||
| 69 | eo_list[*eo_count][moves] = 0; | 71 | eo_list[*eo_count][moves] = 0; |
| 70 | 72 | ||
| 71 | /* If not nissing already and we either have not done any move yet or | 73 | /* If not nissing already and we either have not done any move yet or |
| @@ -152,6 +154,8 @@ void niss_dr_from_eo_dfs(int co, int epos, int scramble[], int eo_moves[30], | |||
| 152 | } | 154 | } |
| 153 | } | 155 | } |
| 154 | 156 | ||
| 157 | if (*dr_count >= m) | ||
| 158 | return; | ||
| 155 | dr_list[*dr_count][moves] = 0; | 159 | dr_list[*dr_count][moves] = 0; |
| 156 | 160 | ||
| 157 | /* If not nissing already and we either have not done any move yet or | 161 | /* If not nissing already and we either have not done any move yet or |
| @@ -296,13 +300,15 @@ void niss_htr_from_dr_dfs(int cp, int eo3, int scramble[], int eodr_moves[30], | |||
| 296 | } | 300 | } |
| 297 | } | 301 | } |
| 298 | 302 | ||
| 303 | if (*htr_count >= m) | ||
| 304 | return; | ||
| 299 | htr_list[*htr_count][moves] = 0; | 305 | htr_list[*htr_count][moves] = 0; |
| 300 | 306 | ||
| 301 | /* If not nissing already and we either have not done any move yet or | 307 | /* If not nissing already and we either have not done any move yet or |
| 302 | * the last move was a quarter turn and I am allowed to niss, try niss! */ | 308 | * the last move was a quarter turn and I am allowed to niss, try niss! */ |
| 303 | if (!niss && last1 % 3 != 2 && can_use_niss && | 309 | if (!niss && last1 % 3 != 2 && can_use_niss && |
| 304 | !(hide && moves > 0 && | 310 | !(hide && moves > 0 && |
| 305 | (last1 % 3 == 0 || (parallel(last1, last2) && last2 % 3 == 0)))) | 311 | (last1 % 3 == 0 || (parallel(last1, last2) && last2 % 3 == 0)))) |
| 306 | niss_htr_from_dr_dfs(premoves_inverse(htr_list[*htr_count], scramble, | 312 | niss_htr_from_dr_dfs(premoves_inverse(htr_list[*htr_count], scramble, |
| 307 | eodr_moves, cp_transition_table), | 313 | eodr_moves, cp_transition_table), |
| 308 | premoves_inverse(htr_list[*htr_count], scramble, | 314 | premoves_inverse(htr_list[*htr_count], scramble, |
