aboutsummaryrefslogtreecommitdiff
path: root/src/solvers/coord/common.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/solvers/coord/common.h')
-rw-r--r--src/solvers/coord/common.h19
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 *);
10STATIC bool solution_lastqt_cw(const solution_moves_t [static 1]); 10STATIC bool solution_lastqt_cw(const solution_moves_t [static 1]);
11STATIC bool coord_can_switch(const coord_t [static 1], const unsigned char *, 11STATIC bool coord_can_switch(const coord_t [static 1], const unsigned char *,
12 size_t, const uint8_t *); 12 size_t, const uint8_t *);
13STATIC bool coord_is_solved(
14 const coord_t [static 1], uint64_t, const unsigned char *);
13 15
14STATIC uint64_t 16STATIC uint64_t
15coord_coord_generic( 17coord_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
204STATIC bool
205coord_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}

Generated with cgit - Back to sebastiano.tronto.net