kpuzzle. Permutations are encoded using lexicographic order. Orientations are encoded as numbers in base 2 (edges), 3 (corners), or 4 (centers).
Components are encoded in the following order:
|Component ID||Meaning||Valid Range||# of bits|
|EP||edge permutation||0 to 12! - 1||29 bits|
|EO||edge orientation||0 to 212-1||12 bits|
|CP||corner permutation||0 to 8! - 1||16 bits|
|CO||corner orientation||0 to 38-1||13 bits|
|PO_U||puzzle orientation (see below)||3 bits|
|MO_Q||whether center ("middle")
orientation is supported
|0 to 1||1 bit|
|MO||center ("middle") orientation||0 to 46-1||12 bit|
Each component is stored with binary bits contiguously from high to low. Example: the high bit of EP is at bit index 0 (first bit of the first byte), and the low bit is at index 28 (5th bit of the third byte).
If puzzle orientation is not encoded:
If center orientation is not encoded:
ULFRBD, skipping the centers currently on U and D).
The other components are encoded relative to centers. That is, reorienting the puzzle changes PO_U and PO_L, but does not affect any other components.
z y' to a solved cube. Now:
Lcenter has moved to
Lis at (zero-indexed) position 1 in
ULFRBD, so PO_U =
Bcenter has moved to
Rcenters are on
D(respectively), so remove
Bis at (zero-indexed) position 2 in
UFBD, so PO_L =