aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2023-10-22 14:48:42 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2023-10-22 14:48:42 +0200
commit0c49ed5afc2ae9e4bc4aa1af9c655bbe1f3d14b8 (patch)
tree4e69457ed87cb06decc12889a1ded18c17610dad /doc
parent259c7326f78d5495f5dc51c619932599a5279f68 (diff)
downloadnissy-core-0c49ed5afc2ae9e4bc4aa1af9c655bbe1f3d14b8.tar.gz
nissy-core-0c49ed5afc2ae9e4bc4aa1af9c655bbe1f3d14b8.zip
Small change of plans, moved stuff around
Diffstat (limited to '')
-rw-r--r--doc/CUBE_INTERNAL.md24
-rw-r--r--doc/CUBE_TEXT.md (renamed from utils/FORMAT.txt)6
-rw-r--r--doc/TRANSFORMATIONS.md (renamed from utils/TRANSFORMATIONS.txt)0
3 files changed, 28 insertions, 2 deletions
diff --git a/doc/CUBE_INTERNAL.md b/doc/CUBE_INTERNAL.md
new file mode 100644
index 0000000..fd3148a
--- /dev/null
+++ b/doc/CUBE_INTERNAL.md
@@ -0,0 +1,24 @@
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/utils/FORMAT.txt b/doc/CUBE_TEXT.md
index 5bfb01e..b9234fc 100644
--- a/utils/FORMAT.txt
+++ b/doc/CUBE_TEXT.md
@@ -1,8 +1,10 @@
1# Textual representation of the cube
2
1The functions readcube() and writecube() use different formats to read 3The functions readcube() and writecube() use different formats to read
2and write a cube to text. Not all formats are supported for both input 4and write a cube to text. Not all formats are supported for both input
3and output. 5and output.
4 6
5# H48 - standard format for h48 (read, write) 7## H48 - standard format for h48 (read, write)
6 8
7Each edge is represented by two letters denoting the sides it belongs to 9Each edge is represented by two letters denoting the sides it belongs to
8and one number denoting its orientation (0 oriented, 1 mis-oriented). 10and one number denoting its orientation (0 oriented, 1 mis-oriented).
@@ -25,7 +27,7 @@ The cube after the moves R'U'F looks like this:
25FL1 BR0 DB0 UR1 UF0 UB0 DL0 FR0 UL1 DF1 BL0 DR0 27FL1 BR0 DB0 UR1 UF0 UB0 DL0 FR0 UL1 DF1 BL0 DR0
26UBL1 DBR1 UFR2 DFR2 DFL2 UBL2 UFL2 DBL0 28UBL1 DBR1 UFR2 DFR2 DFL2 UBL2 UFL2 DBL0
27 29
28# SRC - representation of the object in C code for cube_array (write) 30## SRC - representation of the object in C code for cube_array (write)
29 31
30The exact format depends on the internal cube representation. It is 32The exact format depends on the internal cube representation. It is
31guaranteed that, if OUT is the output in this format, the line 33guaranteed that, if OUT is the output in this format, the line
diff --git a/utils/TRANSFORMATIONS.txt b/doc/TRANSFORMATIONS.md
index 58446e8..58446e8 100644
--- a/utils/TRANSFORMATIONS.txt
+++ b/doc/TRANSFORMATIONS.md

Generated with cgit - Back to sebastiano.tronto.net