diff options
Diffstat (limited to 'src/nissy.h')
| -rw-r--r-- | src/nissy.h | 41 |
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 | /* |
| 103 | The value NISSY_ERROR_INVALID_VARIATION means that the given method of | ||
| 104 | finding variations for a solution is not known. | ||
| 105 | */ | ||
| 106 | #define NISSY_ERROR_INVALID_VARIATION -51LL | ||
| 107 | |||
| 108 | /* | ||
| 102 | The value NISSY_ERROR_NULL_POINTER means that one of the provided pointer | 109 | The value NISSY_ERROR_NULL_POINTER means that one of the provided pointer |
| 103 | arguments is NULL. For example, it may be returned by solve when called | 110 | arguments is NULL. For example, it may be returned by solve when called |
| 104 | with a solver that requires some pre-computed data, but the provided | 111 | with a solver that requires some pre-computed data, but the provided |
| @@ -205,6 +212,36 @@ nissy_applytrans( | |||
| 205 | ); | 212 | ); |
| 206 | 213 | ||
| 207 | /* | 214 | /* |
| 215 | Find variations of a given move sequence, for example by changing | ||
| 216 | the direction of the last quarter turn(s), or linearizing a NISS move | ||
| 217 | sequence. The result consists of one or more move sequences, one per line, | ||
| 218 | and it always ends in a newline character. | ||
| 219 | |||
| 220 | Parameters: | ||
| 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 | |||
| 227 | Return 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 | */ | ||
| 236 | long long | ||
| 237 | nissy_variations( | ||
| 238 | const char *moves, | ||
| 239 | const char *variation, | ||
| 240 | unsigned long long result_size, | ||
| 241 | char *result | ||
| 242 | ); | ||
| 243 | |||
| 244 | /* | ||
| 208 | Get the cube with the given ep, eo, cp and co values. The values must be in the | 245 | Get the cube with the given ep, eo, cp and co values. The values must be in the |
| 209 | ranges specified below, but if the option "fix" is given any values outside its | 246 | ranges specified below, but if the option "fix" is given any values outside its |
| 210 | range will be adjusted before using it. The option "fix" also fixes parity and | 247 | range 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 | /* |
| 405 | Count the given moves. | ||
| 406 | |||
| 368 | Parameters: | 407 | Parameters: |
| 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 | /* |
| 421 | Compare the two moves sequences. Both must be at most NISSY_SIZE_MOVES long. | ||
| 422 | |||
| 382 | Parameters: | 423 | Parameters: |
| 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. |
