aboutsummaryrefslogtreecommitdiff
path: root/src/cube.h
blob: 9ddeefad58aa28f180b667fd745fa4d49c4418ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
typedef struct {
	uint8_t c[16];
	uint8_t e[16];
} cube_arr_t;
#ifdef CUBE_AVX2
typedef __m256i cube_t;
#else
typedef cube_arr_t cube_t;
#endif

typedef uint8_t move_t;
typedef uint8_t trans_t;

int readmoves(char *, move_t *);
void writemoves(move_t *, int, char *);
trans_t readtrans(char *);
void writetrans(trans_t, char *);

typedef enum {H48, SRC} format_t;
cube_t readcube(format_t, char *);        /* Supports: H48 */
void writecube(format_t, cube_t, char *); /* Supports: H48, SRC */

cube_t solvedcube(void);
cube_t zerocube(void);
bool issolvable(cube_t);
bool equal(cube_t, cube_t);
bool issolved(cube_t);
bool iserror(cube_t);

cube_t move(cube_t, move_t);
cube_t inverse(cube_t);
cube_t compose(cube_t, cube_t);
cube_t transform(cube_t, trans_t);

Generated with cgit - Back to sebastiano.tronto.net