Twizzle Binary 3x3x3 Format

Orientation and permutation is defined using the Reid-based definition used by kpuzzle. Permutations are encoded using lexicographic order. Orientations are encoded as numbers in base 2 (edges), 3 (corners), or 4 (centers).

Components

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
PO_L 2 bits
MO_Q whether center ("middle")
orientation is supported
0 to 1 1 bit
MO center ("middle") orientation 0 to 46-1 12 bit

Validation

Note that this encoding includes the full state of each of these components, without relying on parity to save bits. Guidelines:

Byte Layout

EP
EP (continued) EO
EO (continued) CP
CP (continued) CO
CO (continued) PO_U PO_L MO_Q MO
MO

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:

Puzzle Orientation

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.

Puzzle Orientation Example

Apply z y' to a solved cube. Now: