aboutsummaryrefslogtreecommitdiff
path: root/cube.h
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2024-04-13 15:31:32 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2024-04-13 15:31:32 +0200
commita18d4b0ba97b301193597a963a77a40ef7c2254b (patch)
treee2137f21fd162380a2cf8ec6e54af959ad4c4d90 /cube.h
parentae055f1fc993d406939f57f11553d218e1efde82 (diff)
downloadcubecore-a18d4b0ba97b301193597a963a77a40ef7c2254b.tar.gz
cubecore-a18d4b0ba97b301193597a963a77a40ef7c2254b.zip
Some renaming
Diffstat (limited to 'cube.h')
-rw-r--r--cube.h40
1 files changed, 9 insertions, 31 deletions
diff --git a/cube.h b/cube.h
index 72447a7..f70e04a 100644
--- a/cube.h
+++ b/cube.h
@@ -16,13 +16,6 @@ corners is with respect to U/D.
16 16
17The permutation of the center pieces is not stored. This means that the 17The permutation of the center pieces is not stored. This means that the
18cube is assumed to be in a fixed orientation. 18cube is assumed to be in a fixed orientation.
19
20TODO: define EO and CO better, explain how to use them
21TODO: encode centers?
22
23The exact cube type structure depends on your system's configuration. If
24you operate on the cube only via the functions provided below, you don't
25need to worry about this.
26******************************************************************************/ 19******************************************************************************/
27 20
28typedef struct { 21typedef struct {
@@ -30,30 +23,15 @@ typedef struct {
30 uint8_t edge[12]; 23 uint8_t edge[12];
31} cube_t; 24} cube_t;
32 25
33/* Returns a copy of the solved cube */ 26cube_t cube_new(void);
34cube_t solvedcube(void); 27cube_t cube_clone(cube_t);
35 28bool cube_consistent(cube_t);
36/* Basic checks on the cube */ 29bool cube_solvable(cube_t);
37bool isconsistent(cube_t); 30bool cube_solved(cube_t);
38bool issolvable(cube_t); 31bool cube_equal(cube_t, cube_t);
39bool issolved(cube_t); 32bool cube_error(cube_t);
40bool equal(cube_t, cube_t); 33cube_t cube_compose(cube_t, cube_t);
41 34cube_t cube_inverse(cube_t);
42/* All functions can return an error value, use iserror() to check this */
43bool iserror(cube_t);
44
45/* Apply the second cube on the first as a move sequence */
46cube_t compose(cube_t, cube_t);
47
48/* Invert the cube */
49cube_t inverse(cube_t);
50
51/* Check if a cube represent a valid state (possibly unsolvable) */
52
53/* TODO comment on these and the format for moves and trans */
54/* For trans, only one trans is supported */
55cube_t applymoves(cube_t, char *);
56cube_t applytrans(cube_t, char *);
57 35
58/****************************************************************************** 36/******************************************************************************
59Read / write utilities 37Read / write utilities

Generated with cgit - Back to sebastiano.tronto.net