aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2024-04-13 15:57:23 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2024-04-13 15:57:23 +0200
commita4598b740fe4b8350b7d09a575c793113c8fde2b (patch)
tree157cdb108564389ecdf1badae2501f890fc2a126 /README.md
parent3ab2f98170908277f70191846e84e5dde185a056 (diff)
downloadcubecore-a4598b740fe4b8350b7d09a575c793113c8fde2b.tar.gz
cubecore-a4598b740fe4b8350b7d09a575c793113c8fde2b.zip
Some renaming, moved stuff around
Diffstat (limited to 'README.md')
-rw-r--r--README.md56
1 files changed, 56 insertions, 0 deletions
diff --git a/README.md b/README.md
index b49cefd..041b8d3 100644
--- a/README.md
+++ b/README.md
@@ -3,3 +3,59 @@
3A simple set of basic routines for working with a 3x3x3 Rubik's Cube. 3A simple set of basic routines for working with a 3x3x3 Rubik's Cube.
4 4
5Work in progress. 5Work in progress.
6
7## How to use CubeCore
8
9TODO
10
11## The cube
12
13Each piece is represented by an (unsigned) 8-bit integer. The 4
14least-significant bits determine which piece it is, the other 4 determine
15the orientation.
16
17Edges are numbered as follows (see also cube.c):
18UF=0 UB=1 DB=2 DF=3 UR=4 UL=5 DL=6 DR=7 FR=8 FL=9 BL=10 BR=11
19
20Corners are numbered as follows:
21UFR=0 UBL=1 DFL=2 DBR=3 UFL=4 UBR=5 DFR=6 DBL=7
22
23The orientation of the edges is with respect to F/B, the orientation of
24corners is with respect to U/D.
25
26The permutation of the center pieces is not stored. This means that the
27cube is assumed to be in a fixed orientation.
28
29## I/O format
30
31Reading and writing is not done directly via stdin / stdout, but via an
32array of char (called buf in the prototypes below).
33
34Multiple representations of the cube as text are supported:
35
36- H48: a human-readable format.
37 Each edge is represented by two letters denoting the sides it
38 belongs to and one number denoting its orientation (0 oriented, 1
39 mis-oriented). Similarly, each corner is represented by three letters and
40 a number (0 oriented, 1 twisted clockwise, 2 twisted counter-clockwise).
41
42 The solved cube looks like this:
43
44 UF0 UB0 DB0 DF0 UR0 UL0 DL0 DR0 FR0 FL0 BL0 BR0
45 UFR0 UBL0 DFL0 DBR0 UFL0 UBR0 DFR0 DBL0
46
47 The cube after the moves R'U'F looks like this:
48
49 FL1 BR0 DB0 UR1 UF0 UB0 DL0 FR0 UL1 DF1 BL0 DR0
50 UBL1 DBR1 UFR2 DFR2 DFL2 UBL2 UFL2 DBL0
51
52 Whitespace (including newlines) between pieces is ignored when reading the
53 cube. A single whitespace character is added between pieces when writing.
54
55- SRC: format used to generate code for internal use.
56 If OUT is the output in SRC format, one can use `cube_t cube = OUT` to
57 declare a new cube object.
58
59- LST: a format for internal use and generating code.
60 The cube is printed as a comma-separated list of 20 integers, as they appear
61 in cube_t. Corners come first, followed by edge (unlike H48).

Generated with cgit - Back to sebastiano.tronto.net