Orbit64.State
A compact, URL-safe interchange format for framed n x n x n cube state.
The whole state is one integer. Each orbit contributes a coordinate in a
range of exactly its own size (see Orbit.radix), and odd cubes add one of
the 24 fixed-center frames. The values are combined by mixed radix and
written in base64url at a fixed width. Nothing is spent on separators or
field alignment; the two leading zero bits identify this member of the
Orbit64 token family as state.
The encoding is canonical for a given slot convention: two coordinate states
produce the same token exactly when they are the same state, so string
equality is state equality. The qualifier matters -- a token records ordinals
and no geometry, so which physical piece "wing 17" is has to be agreed
elsewhere. Orbit64.Net is where this package says what it assumes.
| cube | bits | chars |
|---|---|---|
| 2x2x2 | 26.39 | 5 |
| 3x3x3 | 69.82 | 12 |
| 4x4x4 | 156.96 | 27 |
| 5x5x5 | 251.90 | 43 |
| 6x6x6 | 390.58 | 66 |
| 7x7x7 | 537.05 | 90 |
Widths are distinct and grow as n^2, so a token's length identifies the
puzzle it belongs to.
Definitions
Construct a state in the canonical reference frame.
Whether n has fixed centers whose physical frame must be carried.
The number of legal coordinate states before the optional frame factor.
Encode a frame-aware state.
On even cubes the frame must be canonical: movable center coordinates already determine the pose, so recording another 24-way choice would duplicate every state. Odd cubes carry one of the 24 fixed-center frames explicitly.
Why an odd cube's corners and midges cannot sit in these permutations, or
nothing. The law couples two orbits, so Orbit64.Coord.faultOf cannot state
it; encode and Orbit64.Net.fromFacelets share it from here.
The framed state of a solved n x n x n cube.
Every coordinate is zero, so this always encodes to a run of As.
The number of frame-aware states the state format addresses.