aboutsummaryrefslogtreecommitdiff
path: root/cube.h
diff options
context:
space:
mode:
Diffstat (limited to 'cube.h')
-rw-r--r--cube.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/cube.h b/cube.h
new file mode 100644
index 0000000..4bbf28a
--- /dev/null
+++ b/cube.h
@@ -0,0 +1,33 @@
1#ifdef CUBE_AVX2
2#include <immintrin.h>
3typedef __m256i cube_t;
4#else
5typedef struct {
6 uint8_t c[16]; /* Only the first 8 are used, the rest is padding */
7 uint8_t e[16]; /* Only the first 12 are used, the rest is padding */
8} cube_t;
9#endif
10
11typedef uint8_t move_t;
12typedef uint8_t trans_t;
13
14int readmoves(char *, move_t *);
15void writemoves(move_t *, int, char *);
16trans_t readtrans(char *);
17void writetrans(trans_t, char *);
18
19typedef enum {AVX, H48, SRC} format_t;
20cube_t readcube(format_t, char *); /* Supports: H48 */
21void writecube(format_t, cube_t, char *); /* Supports: AVX, H48, SRC */
22
23cube_t solvedcube(void);
24cube_t zerocube(void);
25bool issolvable(cube_t);
26bool equal(cube_t, cube_t);
27bool issolved(cube_t);
28bool iserror(cube_t);
29
30cube_t move(cube_t, move_t);
31cube_t inverse(cube_t);
32cube_t compose(cube_t, cube_t);
33cube_t transform(cube_t, trans_t);

Generated with cgit - Back to sebastiano.tronto.net