aboutsummaryrefslogtreecommitdiff
path: root/src/cube_public.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_public.h
parent832ad3dcf3818e57c53304ea9b09a943e785a16b (diff)
downloadnissy-core-d9f40f59c9f14bef7f87c11da7494f7dcf1457b4.tar.gz
nissy-core-d9f40f59c9f14bef7f87c11da7494f7dcf1457b4.zip
Started cube.h refactor
Diffstat (limited to 'src/cube_public.h')
-rw-r--r--src/cube_public.h83
1 files changed, 83 insertions, 0 deletions
diff --git a/src/cube_public.h b/src/cube_public.h
new file mode 100644
index 0000000..7f7b81c
--- /dev/null
+++ b/src/cube_public.h
@@ -0,0 +1,83 @@
1int check(cube_t, char [static 22]);
2
3int
4check(cube_t cube, char result[static 22])
5{
6 if (!isconsistent(cube)) {
7 writecube("B32", zero, result);
8 return 2;
9 }
10
11 return issolvable(cube) ? 0 : 1;
12}
13
14int
15nissy_compose(
16 const char cube[static 22],
17 const char permutation[static 22],
18 char result[static 22]
19)
20{
21 cube_t c, p, res;
22
23 c = readcube("B32", cube);
24 p = readcube("B32", permutation);
25
26 res = compose(c, p);
27
28 return check(res, result);
29}
30
31int
32nissy_inverse(
33 const char cube[static 22],
34 char result[static 22]
35);
36
37int nissy_applymoves(
38 const char cube[static 22],
39 const char *moves,
40 char result[static 22]
41);
42
43int nissy_applytrans(
44 const char cube[static 22],
45 const char *transformation,
46 char result[static 22]
47);
48
49int nissy_frommoves(
50 const char *moves,
51 char result[static 22]
52);
53
54int nissy_readcube(
55 const char *format,
56 const char *cube_string,
57 char result[static 22]
58);
59
60int nissy_writecube(
61 const char *format,
62 const char cube[static 22],
63 char *result
64);
65
66int64_t nissy_gendata(
67 const char *solver,
68 const char *options,
69 void *data
70);
71
72int64_t nissy_solve(
73 const char cube[static 22],
74 const char *solver,
75 const char *options,
76 const char *nisstype,
77 int8_t minmoves,
78 int8_t maxmoves,
79 int64_t maxsolutions,
80 int8_t optimal,
81 const void *data,
82 char *solutions
83);

Generated with cgit - Back to sebastiano.tronto.net