diff options
Diffstat (limited to '')
| -rw-r--r-- | src/cube.h | 79 |
1 files changed, 56 insertions, 23 deletions
| @@ -1,32 +1,65 @@ | |||
| 1 | /* TODO: change cube to const char [static 22], or const char * */ | 1 | /* |
| 2 | /* TODO: return error code */ | 2 | All the functions below return 0 in case of success and a positive number |
| 3 | /* TODO: implement all of this, or move the implementation to cube_public.h */ | 3 | in case of error. See (TODO: documentation) for details. |
| 4 | /* TODO: document in a separate file, possibly leave here 1-line comments */ | 4 | */ |
| 5 | 5 | ||
| 6 | cube_t compose(cube_t cube, cube_t perm); | 6 | int nissy_compose( |
| 7 | cube_t inverse(cube_t cube); | 7 | const char cube[static 22], |
| 8 | cube_t solvedcube(void); | 8 | const char permutation[static 22], |
| 9 | cube_t applymoves(cube_t, const char *); | 9 | char result[static 22] |
| 10 | cube_t applytrans(cube_t, const char *); | 10 | ); |
| 11 | cube_t readcube(const char *format, const char *buf); | 11 | |
| 12 | void writecube(const char *format, cube_t cube, char *buf); | 12 | int nissy_inverse( |
| 13 | int64_t solve( | 13 | const char cube[static 22], |
| 14 | cube_t cube, | 14 | char result[static 22] |
| 15 | ); | ||
| 16 | |||
| 17 | int nissy_applyoves( | ||
| 18 | const char cube[static 22], | ||
| 19 | const char *moves, | ||
| 20 | char result[static 22] | ||
| 21 | ); | ||
| 22 | |||
| 23 | int nissy_applytrans( | ||
| 24 | const char cube[static 22], | ||
| 25 | const char *transformation, | ||
| 26 | char result[static 22] | ||
| 27 | ); | ||
| 28 | |||
| 29 | int nissy_frommoves( | ||
| 30 | const char *moves, | ||
| 31 | char result[static 22] | ||
| 32 | ); | ||
| 33 | |||
| 34 | int nissy_readcube( | ||
| 35 | const char *format, | ||
| 36 | const char *cube_string, | ||
| 37 | char result[static 22] | ||
| 38 | ); | ||
| 39 | |||
| 40 | int nissy_writecube( | ||
| 41 | const char *format, | ||
| 42 | const char cube[static 22], | ||
| 43 | char *result | ||
| 44 | ); | ||
| 45 | |||
| 46 | int nissy_gendata( | ||
| 47 | const char *solver, | ||
| 48 | const char *options, | ||
| 49 | void *generated_data, | ||
| 50 | int64_t *generated_bytes | ||
| 51 | ); | ||
| 52 | |||
| 53 | int nissy_solve( | ||
| 54 | const char cube[static 22], | ||
| 15 | const char *solver, | 55 | const char *solver, |
| 16 | const char *options, | 56 | const char *options, |
| 17 | const char *nisstype, | 57 | const char *nisstype, |
| 18 | int8_t minmoves, | 58 | int8_t minmoves, |
| 19 | int8_t maxmoves, | 59 | int8_t maxmoves, |
| 20 | int64_t maxsols, | 60 | int64_t maxsolutions, |
| 21 | int8_t optimal, | 61 | int8_t optimal, |
| 22 | const void *data, | ||
| 23 | char *solutions | ||
| 24 | ); | ||
| 25 | void multisolve( | ||
| 26 | int n, | ||
| 27 | cube_t *cube, | ||
| 28 | const char *solver, | ||
| 29 | const void *data, | 62 | const void *data, |
| 30 | char *sols | 63 | char *solutions, |
| 64 | int *n_solutions | ||
| 31 | ); | 65 | ); |
| 32 | int64_t gendata(const char *solver, const char *options, void *data); | ||
