aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2023-10-31 19:17:42 +0100
committerSebastiano Tronto <sebastiano@tronto.net>2023-10-31 19:17:42 +0100
commitd65ce8e86b517ef3f7d48cf5ded1101444e05b2b (patch)
tree6ac473a067fa06dbd64691adf2ddaafd8adc6e06 /doc
parentbc2e6b8a8d5a6eccd2c2ac433e8a307ee356f14e (diff)
downloadnissy-core-d65ce8e86b517ef3f7d48cf5ded1101444e05b2b.tar.gz
nissy-core-d65ce8e86b517ef3f7d48cf5ded1101444e05b2b.zip
Reorganized documentation
Diffstat (limited to 'doc')
-rw-r--r--doc/CUBE_INTERNAL.md24
-rw-r--r--doc/CUBE_TEXT.md37
-rw-r--r--doc/TRANSFORMATIONS.md23
3 files changed, 0 insertions, 84 deletions
diff --git a/doc/CUBE_INTERNAL.md b/doc/CUBE_INTERNAL.md
deleted file mode 100644
index fd3148a..0000000
--- a/doc/CUBE_INTERNAL.md
+++ /dev/null
@@ -1,24 +0,0 @@
1# Internal representation of the cube
2
3The plan (TODO) is to have multiple implementations: some that
4take advantage of advanced CPU instructions (SIMD) and a fallback
5"array" representation that works on any architecture.
6
7# Array representation (fallback)
8
9In this implementation of the cube.h interface, the cube is represented
10by two arrays of 8-bit unsigned integers, one for centers and one for
11corners. The 4 leas-significant digits of each bit determine the piece,
12the other 4 are used for orientation or kept to 0.
13
14Edges:
15 xxxopppp (x = unused, o = orientation, p = piece)
16
17Corners:
18 xooxpppp (x = unused, o = orientation, p = piece)
19
20The two bits for CO are shifted to make it possible to perform mod 3
21operations (sum, inverse) using only addition and bitwise operators.
22See below for details.
23
24The third bit is needed because x+y+1 can exceed 4.
diff --git a/doc/CUBE_TEXT.md b/doc/CUBE_TEXT.md
deleted file mode 100644
index b9234fc..0000000
--- a/doc/CUBE_TEXT.md
+++ /dev/null
@@ -1,37 +0,0 @@
1# Textual representation of the cube
2
3The functions readcube() and writecube() use different formats to read
4and write a cube to text. Not all formats are supported for both input
5and output.
6
7## H48 - standard format for h48 (read, write)
8
9Each edge is represented by two letters denoting the sides it belongs to
10and one number denoting its orientation (0 oriented, 1 mis-oriented).
11Similarly, each corner is represented by three letters and a number
12(0 oriented, 1 twisted clockwise, 2 twisted counter-clockwise).
13Edge orientation is relative to the F / B axis, corner orientation is
14relative to the U / D axis.
15
16The pieces are ordered such that the solved cube looks like this:
17
18UF0 UB0 DB0 DF0 UR0 UL0 DL0 DR0 FR0 FL0 BL0 BR0
19UFR0 UBL0 DFL0 DBR0 UFL0 UBR0 DFR0 DBL0
20
21Whitespace (including newlines) between pieces is ignored when reading
22the cube, and a single whitespace character is added between pieces
23when writing.
24
25The cube after the moves R'U'F looks like this:
26
27FL1 BR0 DB0 UR1 UF0 UB0 DL0 FR0 UL1 DF1 BL0 DR0
28UBL1 DBR1 UFR2 DFR2 DFL2 UBL2 UFL2 DBL0
29
30## SRC - representation of the object in C code for cube_array (write)
31
32The exact format depends on the internal cube representation. It is
33guaranteed that, if OUT is the output in this format, the line
34
35cube_t cube = OUT;
36
37is interpreted correctly by h48.
diff --git a/doc/TRANSFORMATIONS.md b/doc/TRANSFORMATIONS.md
deleted file mode 100644
index 58446e8..0000000
--- a/doc/TRANSFORMATIONS.md
+++ /dev/null
@@ -1,23 +0,0 @@
1Transformations can be either simple rotations or a rotation composed
2with a mirroring.
3
4Simple rotations are denoted by two letters corresponding to the faces
5to be moved to the U and F positions, respectively. For example FD is
6the rotation that brings the F face on top and the D face on front.
7
8A composed rotation + mirror is obtained by applying the corresponding
9rotation to the solved cube mirrored along the M plane.
10
11For example, to apply the transformation RBm (mirrored RB) to a cube C:
12 1a. Apply a mirror along the M plane to the solved cube
13 1b. Rotate the mirrored cube with z' y2
14 3. Apply the cube C to the transformed solved cube
15 4. Apply the transformations of step 1a and 1b in reverse
16
17The orientation of pieces after a rotation ignores the new position
18of centers. A rotated cube can technically be inconsistent, because
19the parity of the edge permutation has to be adjusted considering the
20parity of the centers, which we ignore.
21
22The utility script mirror.sh transforms a solved, rotated cube to its
23mirrored and rotated version.

Generated with cgit - Back to sebastiano.tronto.net