aboutsummaryrefslogtreecommitdiff
path: root/src/nissy.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/nissy.h')
-rw-r--r--src/nissy.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/nissy.h b/src/nissy.h
index 38fe656..959b2d8 100644
--- a/src/nissy.h
+++ b/src/nissy.h
@@ -27,6 +27,7 @@ for example 'rotation UF' or 'mirrored BL'.
27#define NISSY_SIZE_TRANSFORMATION 12U 27#define NISSY_SIZE_TRANSFORMATION 12U
28#define NISSY_SIZE_SOLVE_STATS 10U 28#define NISSY_SIZE_SOLVE_STATS 10U
29#define NISSY_SIZE_DATAID 255U 29#define NISSY_SIZE_DATAID 255U
30#define NISSY_SIZE_MOVES 1000U
30 31
31/* Flags for NISS options */ 32/* Flags for NISS options */
32#define NISSY_NISSFLAG_NORMAL 1U 33#define NISSY_NISSFLAG_NORMAL 1U
@@ -99,6 +100,12 @@ not known.
99#define NISSY_ERROR_INVALID_SOLVER -50LL 100#define NISSY_ERROR_INVALID_SOLVER -50LL
100 101
101/* 102/*
103The value NISSY_ERROR_INVALID_VARIATION means that the given method of
104finding variations for a solution is not known.
105*/
106#define NISSY_ERROR_INVALID_VARIATION -51LL
107
108/*
102The value NISSY_ERROR_NULL_POINTER means that one of the provided pointer 109The value NISSY_ERROR_NULL_POINTER means that one of the provided pointer
103arguments is NULL. For example, it may be returned by solve when called 110arguments is NULL. For example, it may be returned by solve when called
104with a solver that requires some pre-computed data, but the provided 111with a solver that requires some pre-computed data, but the provided
@@ -205,6 +212,36 @@ nissy_applytrans(
205); 212);
206 213
207/* 214/*
215Find variations of a given move sequence, for example by changing
216the direction of the last quarter turn(s), or linearizing a NISS move
217sequence. The result consists of one or more move sequences, one per line,
218and it always ends in a newline character.
219
220Parameters:
221 moves - The moves of which to find the variation. Must be at most
222 NISSY_SIZE_MOVES long.
223 variations - Specify which kind of variations to find, e.g. "lastqt".
224 result_size - The size of the result buffer.
225 result - The result buffer.
226
227Return values:
228 NISSY_ERROR_NULL_POINTER - One of the provided pointers is NULL.
229 NISSY_ERROR_INVALID_MOVES - The given moves are invalid.
230 NISSY_ERROR_INVALID_VARIATION - The given transformer is not known.
231 NISSY_ERROR_BUFFER_SIZE - Either the result buffer is too small or the
232 given move sequence is longer than
233 NISSY_SIZE_MOVES.
234 Any value >= 0 - The number of variations found.
235*/
236long long
237nissy_variations(
238 const char *moves,
239 const char *variation,
240 unsigned long long result_size,
241 char *result
242);
243
244/*
208Get the cube with the given ep, eo, cp and co values. The values must be in the 245Get the cube with the given ep, eo, cp and co values. The values must be in the
209ranges specified below, but if the option "fix" is given any values outside its 246ranges specified below, but if the option "fix" is given any values outside its
210range will be adjusted before using it. The option "fix" also fixes parity and 247range will be adjusted before using it. The option "fix" also fixes parity and
@@ -365,6 +402,8 @@ nissy_solve(
365); 402);
366 403
367/* 404/*
405Count the given moves.
406
368Parameters: 407Parameters:
369 moves - The moves to be counted. 408 moves - The moves to be counted.
370 409
@@ -379,6 +418,8 @@ nissy_countmoves(
379); 418);
380 419
381/* 420/*
421Compare the two moves sequences. Both must be at most NISSY_SIZE_MOVES long.
422
382Parameters: 423Parameters:
383 moves1 - The first sequence of moves to compare. 424 moves1 - The first sequence of moves to compare.
384 moves2 - The second sequence of moves to compare. 425 moves2 - The second sequence of moves to compare.

Generated with cgit - Back to sebastiano.tronto.net