A step-by-step walkthrough of building a Rubik's cube solver from scratch. Starts with a 3D graphical representation using cubelet meshes and facelets, then builds a compact bit-packed state representation for edges and corners including orientation tracking. Implements a brute-force recursive search, then progressively optimizes with move pruning, multithreading, a greedy heuristic evaluator, a meet-in-the-middle 'sandwich' approach, and finally a two-phase 'oriented solver' that first corrects edge orientations to reduce the move set from 18 to 12. The final solver achieves a 99.8% success rate across 1000 random scrambles, averaging 40 moves and 8 seconds of computation time.
•24m watch time
Sort: