diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/moves.h | 8 | ||||
| -rw-r--r-- | src/solvers/h48/solve.h | 7 |
2 files changed, 7 insertions, 8 deletions
diff --git a/src/core/moves.h b/src/core/moves.h index 726a452..b28822a 100644 --- a/src/core/moves.h +++ b/src/core/moves.h | |||
| @@ -1,8 +1,8 @@ | |||
| 1 | /* probably these can be placed in constants file */ | 1 | /* probably these can be placed in constants file */ |
| 2 | #define NONISS 0x00 | 2 | #define NORMAL 0x00 |
| 3 | #define NISS 0x01 | 3 | #define INVERSE 0x01 |
| 4 | #define INVERSEBRANCH 0x03 | 4 | #define INVERSEBRANCH 0x03 |
| 5 | #define BRANCH 0x02 | 5 | #define NORMALBRANCH 0x02 |
| 6 | #define ALLMOVES 0x3FFFF | 6 | #define ALLMOVES 0x3FFFF |
| 7 | #define NOHALFTURNS 0x2DB6D | 7 | #define NOHALFTURNS 0x2DB6D |
| 8 | 8 | ||
| @@ -53,7 +53,7 @@ _static uint32_t | |||
| 53 | allowednextmoveH48(uint8_t *moves, uint8_t n, uint32_t h48branch) | 53 | allowednextmoveH48(uint8_t *moves, uint8_t n, uint32_t h48branch) |
| 54 | { | 54 | { |
| 55 | uint32_t result = ALLMOVES; | 55 | uint32_t result = ALLMOVES; |
| 56 | if (h48branch & BRANCH) | 56 | if (h48branch & NORMALBRANCH) |
| 57 | result &= NOHALFTURNS; | 57 | result &= NOHALFTURNS; |
| 58 | if (n < 1) | 58 | if (n < 1) |
| 59 | return result; | 59 | return result; |
diff --git a/src/solvers/h48/solve.h b/src/solvers/h48/solve.h index 751df8f..ed06a85 100644 --- a/src/solvers/h48/solve.h +++ b/src/solvers/h48/solve.h | |||
| @@ -66,7 +66,7 @@ solve_h48_stop(dfsarg_solveh48_t *arg) | |||
| 66 | uint32_t data, data_inv; | 66 | uint32_t data, data_inv; |
| 67 | int8_t bound; | 67 | int8_t bound; |
| 68 | 68 | ||
| 69 | arg->nissbranch = NONISS; | 69 | arg->nissbranch = NORMAL; |
| 70 | bound = get_h48_cdata(arg->cube, arg->cocsepdata, &data); | 70 | bound = get_h48_cdata(arg->cube, arg->cocsepdata, &data); |
| 71 | if (bound + arg->nmoves + arg->npremoves > arg->depth) | 71 | if (bound + arg->nmoves + arg->npremoves > arg->depth) |
| 72 | return true; | 72 | return true; |
| @@ -86,7 +86,7 @@ solve_h48_stop(dfsarg_solveh48_t *arg) | |||
| 86 | if (bound + arg->nmoves + arg->npremoves > arg->depth) | 86 | if (bound + arg->nmoves + arg->npremoves > arg->depth) |
| 87 | return true; | 87 | return true; |
| 88 | if (bound + arg->nmoves + arg->npremoves == arg->depth) | 88 | if (bound + arg->nmoves + arg->npremoves == arg->depth) |
| 89 | arg->nissbranch = BRANCH; | 89 | arg->nissbranch = NORMALBRANCH; |
| 90 | 90 | ||
| 91 | return false; | 91 | return false; |
| 92 | } | 92 | } |
| @@ -115,7 +115,7 @@ solve_h48_dfs(dfsarg_solveh48_t *arg) | |||
| 115 | nextarg = *arg; | 115 | nextarg = *arg; |
| 116 | ret = 0; | 116 | ret = 0; |
| 117 | uint32_t allowed; | 117 | uint32_t allowed; |
| 118 | if(arg->nissbranch & 0x01) { | 118 | if(arg->nissbranch & INVERSE) { |
| 119 | allowed = allowednextmoveH48(arg->premoves, arg->npremoves, arg->nissbranch); | 119 | allowed = allowednextmoveH48(arg->premoves, arg->npremoves, arg->nissbranch); |
| 120 | for (m = 0; m < 18; m++) { | 120 | for (m = 0; m < 18; m++) { |
| 121 | if(allowed & (1 << m)) { | 121 | if(allowed & (1 << m)) { |
| @@ -139,7 +139,6 @@ solve_h48_dfs(dfsarg_solveh48_t *arg) | |||
| 139 | } | 139 | } |
| 140 | } | 140 | } |
| 141 | 141 | ||
| 142 | |||
| 143 | return ret; | 142 | return ret; |
| 144 | } | 143 | } |
| 145 | 144 | ||
