diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2024-08-18 14:26:45 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2024-08-18 14:26:45 +0200 |
| commit | 18c9a8b8905304cf5f8fc15825769046a3144866 (patch) | |
| tree | a7807bb32b0a5d9ded7d3cedccc598f64a9b00fe /src/cube.h | |
| parent | f25a10e19eca294c4e6a99e4f80ce5cfd11a0e5f (diff) | |
| download | nissy-core-18c9a8b8905304cf5f8fc15825769046a3144866.tar.gz nissy-core-18c9a8b8905304cf5f8fc15825769046a3144866.zip | |
Reorganized folder structure
Diffstat (limited to 'src/cube.h')
| -rw-r--r-- | src/cube.h | 104 |
1 files changed, 0 insertions, 104 deletions
diff --git a/src/cube.h b/src/cube.h deleted file mode 100644 index 346b99a..0000000 --- a/src/cube.h +++ /dev/null | |||
| @@ -1,104 +0,0 @@ | |||
| 1 | /* | ||
| 2 | If you include this file, you should also include the following: | ||
| 3 | |||
| 4 | inttypes, stdarg, stdbool, string | ||
| 5 | |||
| 6 | All the functions below return 0 in case of success and a positive | ||
| 7 | number in case of error, unless otherwise specified. | ||
| 8 | |||
| 9 | Arguments of type char [static 22] denote a cube in B32 format. | ||
| 10 | Other available formats are H48 and SRC. See README.md for more info on | ||
| 11 | these formats. | ||
| 12 | |||
| 13 | Accepted moves are U, D, R, L, F and B, optionally followed by a 2, | ||
| 14 | a ' or a 3. | ||
| 15 | |||
| 16 | A transformation must be given in the format | ||
| 17 | (rotation|mirrored) (2 letters) | ||
| 18 | for example 'rotation UF' or 'mirrored BL'. | ||
| 19 | */ | ||
| 20 | |||
| 21 | /* Apply the secod argument as a permutation on the first argument */ | ||
| 22 | int64_t nissy_compose( | ||
| 23 | const char cube[static 22], | ||
| 24 | const char permutation[static 22], | ||
| 25 | char result[static 22] | ||
| 26 | ); | ||
| 27 | |||
| 28 | /* Compute the inverse of the given cube */ | ||
| 29 | int64_t nissy_inverse( | ||
| 30 | const char cube[static 22], | ||
| 31 | char result[static 22] | ||
| 32 | ); | ||
| 33 | |||
| 34 | /* Apply the given sequence of moves on the given cube */ | ||
| 35 | int64_t nissy_applymoves( | ||
| 36 | const char cube[static 22], | ||
| 37 | const char *moves, | ||
| 38 | char result[static 22] | ||
| 39 | ); | ||
| 40 | |||
| 41 | /* Apply the single given transformation to the given cube */ | ||
| 42 | int64_t nissy_applytrans( | ||
| 43 | const char cube[static 22], | ||
| 44 | const char *transformation, | ||
| 45 | char result[static 22] | ||
| 46 | ); | ||
| 47 | |||
| 48 | /* Return the cube obtained by applying the given moves to the solved cube */ | ||
| 49 | int64_t nissy_frommoves( | ||
| 50 | const char *moves, | ||
| 51 | char result[static 22] | ||
| 52 | ); | ||
| 53 | |||
| 54 | /* Convert the given cube between the two given formats */ | ||
| 55 | int64_t nissy_convert( | ||
| 56 | const char *format_in, | ||
| 57 | const char *format_out, | ||
| 58 | const char *cube_string, | ||
| 59 | char *result | ||
| 60 | ); | ||
| 61 | |||
| 62 | /* Get the cube with the given ep, eo, cp and co values. */ | ||
| 63 | int64_t nissy_getcube( | ||
| 64 | int64_t ep, | ||
| 65 | int64_t eo, | ||
| 66 | int64_t cp, | ||
| 67 | int64_t co, | ||
| 68 | const char *options, | ||
| 69 | char result[static 22] | ||
| 70 | ); | ||
| 71 | |||
| 72 | /* | ||
| 73 | Returns the size of the data generated by nissy_gendata, when called with | ||
| 74 | the same parameters, or -1 in case of error. The returned value can be | ||
| 75 | slightly larger than the actual table size. | ||
| 76 | */ | ||
| 77 | int64_t nissy_datasize( | ||
| 78 | const char *solver, | ||
| 79 | const char *options /* TODO: remove options, use only solver name */ | ||
| 80 | ); | ||
| 81 | |||
| 82 | /* Returns the number of bytes written, or -1 in case of error */ | ||
| 83 | int64_t nissy_gendata( | ||
| 84 | const char *solver, | ||
| 85 | const char *options, /* TODO: remove options, use only solver name */ | ||
| 86 | void *generated_data | ||
| 87 | ); | ||
| 88 | |||
| 89 | /* Returns the number of solutions found, or -1 in case of error */ | ||
| 90 | int64_t nissy_solve( | ||
| 91 | const char cube[static 22], | ||
| 92 | const char *solver, | ||
| 93 | const char *options, /* TODO: remove options, use only solver name */ | ||
| 94 | const char *nisstype, /* TODO: remove, use flags */ | ||
| 95 | int8_t minmoves, | ||
| 96 | int8_t maxmoves, | ||
| 97 | int64_t maxsolutions, | ||
| 98 | int8_t optimal, | ||
| 99 | const void *data, | ||
| 100 | char *solutions | ||
| 101 | ); | ||
| 102 | |||
| 103 | /* Set a global logger function used by this library. */ | ||
| 104 | void nissy_setlogger(void (*logger_function)(const char *, ...)); | ||
