aboutsummaryrefslogtreecommitdiff
path: root/src/cube.h
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2024-06-10 22:22:03 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2024-06-10 22:22:03 +0200
commitd9f40f59c9f14bef7f87c11da7494f7dcf1457b4 (patch)
treed8d63db63a9558b0befbd0ec6c267dd13be20dfa /src/cube.h
parent832ad3dcf3818e57c53304ea9b09a943e785a16b (diff)
downloadnissy-core-d9f40f59c9f14bef7f87c11da7494f7dcf1457b4.tar.gz
nissy-core-d9f40f59c9f14bef7f87c11da7494f7dcf1457b4.zip
Started cube.h refactor
Diffstat (limited to 'src/cube.h')
-rw-r--r--src/cube.h79
1 files changed, 56 insertions, 23 deletions
diff --git a/src/cube.h b/src/cube.h
index d30c1d4..b5f4211 100644
--- a/src/cube.h
+++ b/src/cube.h
@@ -1,32 +1,65 @@
1/* TODO: change cube to const char [static 22], or const char * */ 1/*
2/* TODO: return error code */ 2All 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 */ 3in case of error. See (TODO: documentation) for details.
4/* TODO: document in a separate file, possibly leave here 1-line comments */ 4*/
5 5
6cube_t compose(cube_t cube, cube_t perm); 6int nissy_compose(
7cube_t inverse(cube_t cube); 7 const char cube[static 22],
8cube_t solvedcube(void); 8 const char permutation[static 22],
9cube_t applymoves(cube_t, const char *); 9 char result[static 22]
10cube_t applytrans(cube_t, const char *); 10);
11cube_t readcube(const char *format, const char *buf); 11
12void writecube(const char *format, cube_t cube, char *buf); 12int nissy_inverse(
13int64_t solve( 13 const char cube[static 22],
14 cube_t cube, 14 char result[static 22]
15);
16
17int nissy_applyoves(
18 const char cube[static 22],
19 const char *moves,
20 char result[static 22]
21);
22
23int nissy_applytrans(
24 const char cube[static 22],
25 const char *transformation,
26 char result[static 22]
27);
28
29int nissy_frommoves(
30 const char *moves,
31 char result[static 22]
32);
33
34int nissy_readcube(
35 const char *format,
36 const char *cube_string,
37 char result[static 22]
38);
39
40int nissy_writecube(
41 const char *format,
42 const char cube[static 22],
43 char *result
44);
45
46int nissy_gendata(
47 const char *solver,
48 const char *options,
49 void *generated_data,
50 int64_t *generated_bytes
51);
52
53int 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);
25void 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);
32int64_t gendata(const char *solver, const char *options, void *data);

Generated with cgit - Back to sebastiano.tronto.net