diff options
Diffstat (limited to 'src/solvers/coord/common.h')
| -rw-r--r-- | src/solvers/coord/common.h | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/solvers/coord/common.h b/src/solvers/coord/common.h index d38b7d3..901b8bd 100644 --- a/src/solvers/coord/common.h +++ b/src/solvers/coord/common.h | |||
| @@ -10,6 +10,8 @@ STATIC void append_coord_name(const coord_t [static 1], char *); | |||
| 10 | STATIC bool solution_lastqt_cw(const solution_moves_t [static 1]); | 10 | STATIC bool solution_lastqt_cw(const solution_moves_t [static 1]); |
| 11 | STATIC bool coord_can_switch(const coord_t [static 1], const unsigned char *, | 11 | STATIC bool coord_can_switch(const coord_t [static 1], const unsigned char *, |
| 12 | size_t, const uint8_t *); | 12 | size_t, const uint8_t *); |
| 13 | STATIC bool coord_is_solved( | ||
| 14 | const coord_t [static 1], uint64_t, const unsigned char *); | ||
| 13 | 15 | ||
| 14 | STATIC uint64_t | 16 | STATIC uint64_t |
| 15 | coord_coord_generic( | 17 | coord_coord_generic( |
| @@ -182,8 +184,11 @@ coord_can_switch( | |||
| 182 | 184 | ||
| 183 | uint64_t i; | 185 | uint64_t i; |
| 184 | 186 | ||
| 185 | if (n == 0) | 187 | DBG_ASSERT(n > 0, "Error: cannot check if coordinate solver " |
| 186 | return true; | 188 | "can use NISS after 0 moves"); |
| 189 | |||
| 190 | if (!coord->allow_niss) | ||
| 191 | return false; | ||
| 187 | 192 | ||
| 188 | i = coord->coord(move(SOLVED_CUBE, moves[n-1]), data); | 193 | i = coord->coord(move(SOLVED_CUBE, moves[n-1]), data); |
| 189 | if (i == 0) | 194 | if (i == 0) |
| @@ -195,3 +200,13 @@ coord_can_switch( | |||
| 195 | i = coord->coord(move(SOLVED_CUBE, moves[n-1]), data); | 200 | i = coord->coord(move(SOLVED_CUBE, moves[n-1]), data); |
| 196 | return i != 0; | 201 | return i != 0; |
| 197 | } | 202 | } |
| 203 | |||
| 204 | STATIC bool | ||
| 205 | coord_is_solved( | ||
| 206 | const coord_t coord[static 1], | ||
| 207 | uint64_t i, | ||
| 208 | const unsigned char *data | ||
| 209 | ) | ||
| 210 | { | ||
| 211 | return coord->is_solved == NULL ? i == 0 : coord->is_solved(i, data); | ||
| 212 | } | ||
