aboutsummaryrefslogtreecommitdiff
path: root/src/cube.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/cube.h28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/cube.h b/src/cube.h
index 4c6de2f..43d9172 100644
--- a/src/cube.h
+++ b/src/cube.h
@@ -1,43 +1,45 @@
1/* Types *********************************************************************/ 1/* Types *********************************************************************/
2 2
3/* See doc/CUBE_INTERNAL.md for a description of the cube format */ 3/* See doc/CUBE_INTERNAL.md for a description of the cube format */
4typedef struct {
5 uint8_t c[16];
6 uint8_t e[16];
7} cube_arr_t;
4#ifdef CUBE_AVX2 8#ifdef CUBE_AVX2
5typedef __m256i cube_t; 9typedef __m256i cube_t;
6#else 10#else
7typedef struct { uint8_t c[8]; uint8_t e[12]; } cube_t; 11typedef cube_arr_t cube_t;
8#endif 12#endif
9 13
10typedef uint8_t move_t; 14typedef uint8_t move_t;
11typedef uint8_t trans_t; 15typedef uint8_t trans_t;
12 16
13extern move_t inverse_move[];
14extern trans_t inverse_trans[];
15extern cube_t solvedcube;
16
17/* Functions *****************************************************************/ 17/* Functions *****************************************************************/
18 18
19int readmoves(char *, move_t *);
20void writemoves(move_t *, int, char *);
21trans_t readtrans(char *);
22void writetrans(trans_t, char *);
23
24move_t inverse_move(move_t);
25trans_t inverse_trans(trans_t);
26
19/* Not all formats are supported for both read and write. */ 27/* Not all formats are supported for both read and write. */
20/* See doc/CUBE_TEXT.md for details. */ 28/* See doc/CUBE_TEXT.md for details. */
21typedef enum {H48, SRC} format_t; 29typedef enum {H48, SRC} format_t;
22cube_t readcube(format_t, char *); 30cube_t readcube(format_t, char *);
23void writecube(format_t, cube_t, char *); 31void writecube(format_t, cube_t, char *);
24 32
33cube_t solvedcube(void);
34cube_t zerocube(void);
25bool issolvable(cube_t); 35bool issolvable(cube_t);
26bool equal(cube_t, cube_t); 36bool equal(cube_t, cube_t);
27bool issolved(cube_t); 37bool issolved(cube_t);
28bool iserror(cube_t); 38bool iserror(cube_t);
29 39
30int readmoves(char *, move_t *);
31void writemoves(move_t *, int, char *);
32
33trans_t readtrans(char *);
34void writetrans(trans_t, char *);
35
36cube_t move(cube_t, move_t); 40cube_t move(cube_t, move_t);
37cube_t inverse(cube_t); 41cube_t inverse(cube_t);
38cube_t compose(cube_t, cube_t); 42cube_t compose(cube_t, cube_t);
39
40/* See doc/TRANSFORMATIONS.md for how transformations are applied */
41cube_t transform(cube_t, trans_t); 43cube_t transform(cube_t, trans_t);
42 44
43/* Constants for moves and transformations ***********************************/ 45/* Constants for moves and transformations ***********************************/

Generated with cgit - Back to sebastiano.tronto.net