A 3×3×3 Rubik's Cube has 43,252,003,274,489,856,000 reachable states.
Alen Yohannan turned them into a scrollbar.1
EveryCube presents a ruler running from the solved cube through that entire combinatorial space. Drag it, enter an index or jump to known patterns such as Superflip and the live 3D cube changes state.1
The site obviously does not have a database containing 43 quintillion rows. Even cloud billing departments have limits.
The trick is to turn a number into a cube state.
Four coordinates are enough
The code splits an integer index into four standard cube coordinates:
- twelve edge orientations, with eleven independent values:
2^11possibilities; - eight corner orientations, with seven independent values:
3^7possibilities; - eight corner permutations:
8!possibilities; - twelve edge permutations, parity-linked to the corners:
12!/2possibilities.3
Multiply them and you get exactly 43,252,003,274,489,856,000.3
EveryCube uses a mixed-radix representation to split any index across those four spaces. The inverse operation can take a cube state and recover its number.2 3
That is the rank/unrank pair.
The number is not a position inside a gigantic stored table. It is a compact description of the position.
The browser constructs the state when you ask for it
Move the ruler and EveryCube computes the corresponding orientations and permutations, places the cubies, then lets react-three-fiber render and animate them.2
The README points out that there is no backend and no database. The application can be deployed as a static Next.js site.2
That is the useful idea.
When a space is enormous but mathematically structured, an index can replace storage.
You do not preserve every possibility. You preserve the rule that reconstructs the one you need.
Illegal cubes disappear in the math
A Rubik's Cube does not allow arbitrary sticker permutations.
The parity of the edge permutation, for example, must match the corner permutation. EveryCube's code therefore picks the edge permutation with the required parity for each rank.3
Orientation has constraints too. The final corner orientation is determined by the first seven. The final edge orientation is likewise derived so the complete state remains valid.3
That detail matters. EveryCube is not indexing every colorful arrangement that vaguely looks like a cube. It is indexing mechanically reachable states under its 3×3×3 model.
Even the famous shortcuts are checked
The ruler includes markers for known patterns.
The project does not simply paste an index from the internet for Superflip or checkerboard. Its README says Superflip is built from its textbook definition and round-tripped through the ranking pipeline. Checkerboard is generated by a small move engine and checked against the pattern's alternating-color property.2
Those checks run when the module loads, according to the project, so an incorrect marker cannot silently ship.2
That is an unreasonable amount of care for a cube scrollbar, which is roughly the correct amount.
An absurd quantity becomes an interface
EveryCube is only a few days old. Its repository was created on August 8 and does not yet contain an explicit license.2
It should not be promoted into a new global mathematics platform because Hacker News enjoyed it for a morning.
As an interactive object, though, it demonstrates a clean way to make an absurd number tangible.
Writing “43 quintillion” gives almost no intuition. Dragging a ruler across that space does not suddenly make its real scale comprehensible either, but it turns the quantity into something navigable.
The stranger part is that the territory never exists all at once.
At each position, the browser reconstructs the tiny slice requested and then moves on.
Forty-three quintillion states, zero table with forty-three quintillion rows.
Sometimes the best database is a function.