Coding Adventure: Rubiks Cube @SebastianLague
Coding Adventure: Rubiks Cube  @SebastianLague
Uploaded May 2026 | Updated September 2026, 3 weeks ago
My attempt at solving the 3x3 Rubik's cube (by programming the computer to do it for me).

Note: in the evaluation function at 22:32 I mention that it falls back to the 'Greedy' evaluator shown previously. However, I forgot that I had made a small change to that function, which is to give a bonus to correctly oriented corners. Sorry for the oversight!

Links:
Support my work (and get early access to new projects): patreon.com/SebastianLague
Source code: github.com/SebLague/Rubiks-Cube
Follow-up video: youtu.be/Eysf6-E3ino?is=Fu6gW1WFUXyDTQoa
Resources and credits:
en.wikipedia.org/wiki/Optimal_solutions_for_the_Rubik%27s_Cube
raw.githubusercontent.com/SebLague/Misc-Project-Info/refs/heads/main/Coding-Adventures/RubiksCube.txt

Chapters:
00:00 Creating the Cube
02:00 Rotation Time!
04:39 Binary State
08:15 Making Moves
12:47 Search and Optimization
15:34 The Greedy Solver
17:53 The Sandwich Solver
20:21 The Oriented Solver
23:39 Final Thoughts
Coding Adventure: Rubiks CubeRPG graphics E04: Walk animation [Blender]Unity Create a Game Series (E08. tile map)Visualizing Data with 7-Segment Displays[xkcd jam] Spirit Rover: Behind the ScenesI Tried Coding a Neural Network to Identify DoodlesCoding Adventure: Sound (and the Fourier Transform)[Unity] Procedural Planets (E05: shader)Introduction to Game Development (E23: stealth game 1/3)Unity Create a Game Series (E01. player controller)Introduction to Game Development (E06: a simple game)RPG graphics E02: Character rig [Blender]
Sebastian Lague |

Coding Adventure: Rubik's Cube

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER