Start work on algorithm document
This commit is contained in:
parent
f72ebd0683
commit
f1f969e84d
@ -10,7 +10,75 @@
|
||||
|
||||
= Algorithm
|
||||
|
||||
== Data format
|
||||
|
||||
[source]
|
||||
----
|
||||
Example: Face 2, level 23
|
||||
|
||||
# Most significant 3 bits are for the face
|
||||
face_number = 0b010
|
||||
|
||||
# This algorithm is always level 23
|
||||
data_bits = level * 2 = 23 * 2 = 46
|
||||
|
||||
# The bit after the data bits is always 1
|
||||
# All subsequent bits are always 0
|
||||
|
||||
Bit : 64 48 32 16 1
|
||||
: | | | | |
|
||||
: 01001011101010001011100010010011 1001001100100l001100000000000000
|
||||
Face number : ^^^
|
||||
Data bits : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^
|
||||
Bit after data bits (1) : ^
|
||||
All remaining bits (0) : ^^^^^^^^^^^^^^
|
||||
----
|
||||
|
||||
[source]
|
||||
----
|
||||
All remaining bits (0) : vvvvvvvvvvvvvv
|
||||
Bit after data bits (1) : v
|
||||
Data bits : vvvvvvvvvvvvvvvvvvvvvvvvvvvvv vvvvvvvvvvvvvvvvv
|
||||
Face number : vvv
|
||||
Bit : 64 48 32 16 1
|
||||
: | | | | |
|
||||
: 01001011101010001011100010010011 1001001100100l001100000000000000
|
||||
Not represented : ^^^^^^^^^^^^^^^
|
||||
0000 (10 bits) : ^^^^^^^^^^
|
||||
WORD1 (13 bits) : ^^^^^^ ^^^^^^^
|
||||
WORD2 (13 bits) : ^^^^^^^^^^^^^
|
||||
WORD3 (13 bits) : ^^^^^^^^^^^^^
|
||||
----
|
||||
|
||||
Alternative format (generated using link:https://github.com/luismartingarcia/protocol[protocol^])
|
||||
|
||||
[source]
|
||||
----
|
||||
./protocol 'Face:3,Data:46,1:1,0:14?bits=32'
|
||||
0 1 2 3
|
||||
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
| Face| Data |
|
||||
+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
| |1| 0 |
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
----
|
||||
|
||||
[source]
|
||||
----
|
||||
./protocol 'WORD3:13,WORD2:13,WORD1:13,Number:10?bits=32'
|
||||
0 1 2 3
|
||||
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
| WORD3 | WORD2 | |
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
| WORD1 | Number |
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
----
|
||||
|
||||
|
||||
== Encoding
|
||||
|
||||
[%header,cols="2m,5a"]
|
||||
|===
|
||||
|Step |Code
|
||||
@ -193,6 +261,8 @@ fn fij_to_cellid(f: u8, s: u32, t: u32) -> u64 {
|
||||
|
||||
|===
|
||||
|
||||
== Wordlist
|
||||
|
||||
++++
|
||||
<style>
|
||||
#header, #content, #footnotes, #footer {
|
||||
|
Loading…
Reference in New Issue
Block a user