aboutsummaryrefslogtreecommitdiff
path: root/cube.h
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2023-11-08 18:53:00 +0100
committerSebastiano Tronto <sebastiano@tronto.net>2023-11-08 18:53:00 +0100
commit5bdf6e73179cf944ce82606545beb0b0d63a59a3 (patch)
treeedc0897f2479e1b069d9e36183b92c0416d243b6 /cube.h
parente2004826a56b1e2cac8b3d5a94535e480ca2855d (diff)
downloadnissy-core-5bdf6e73179cf944ce82606545beb0b0d63a59a3.tar.gz
nissy-core-5bdf6e73179cf944ce82606545beb0b0d63a59a3.zip
Improved comments
Diffstat (limited to 'cube.h')
-rw-r--r--cube.h41
1 files changed, 38 insertions, 3 deletions
diff --git a/cube.h b/cube.h
index 3f9b509..889569f 100644
--- a/cube.h
+++ b/cube.h
@@ -169,9 +169,44 @@ int16_t coord_eo(cube_t); /* Edge orientation */
169/****************************************************************************** 169/******************************************************************************
170Solvers 170Solvers
171 171
172Solvers return -1 in case of error, the number of solutions otherwise 172All solvers work at fixed depth, i.e. they will only find solutions of the
173specified length. Iterating over the possible lengths, if desired, is left as
174an implementation detail for the user of this library.
173 175
174TODO 176The solutions are returned as a list of moves, which can then be converted to
177a string using writemoves().
178
179Unless specified otherwise, all the solutions are not trivially simplifiable.
180This means that sequences like U U2 or R L R will not appear in any solution.
181Moreover, two consecutive parallel moves are always going to be sorted in
182increasing order. For example, L R2 may never appear in a solution, but R2 L
183could.
184
185Solvers return -1 in case of error, the number of solutions found otherwise.
186
187TODO NISS / INVERSE / LINEAR as a mask?
188
189All solvers take at least the following parameters, satisfying the conditions
190in square brackets:
191 - cube_t cube [issolvable(cube)]: The cube to solve.
192 - uint8_t depth [depth <= 20]: The lenght of the solution.
193 - int maxsols: The maximum number of solutions to find. The solver
194 stops when the limit is reached. If set to a negative number, all
195 the solutions are found.
196 - move_t *ret: The array where the moves of the solutions are stored.
197 There is no separator between different solutions; to read the
198 solutions, use the fact that all solutions has the same length: the
199 i-th move of the j-th solution is ret[j*depth + i].
200
201Some solvers take other parameters. See below for details.
175******************************************************************************/ 202******************************************************************************/
176 203
177int solve_generic(cube_t, int (*)(cube_t), uint8_t, int, move_t *); 204int solve_generic(
205 cube_t cube,
206 uint8_t depth,
207 int maxsols,
208 move_t *ret
209 int (*estimate)(cube_t),
210);
211
212int solve_light(cube_t, int

Generated with cgit - Back to sebastiano.tronto.net