GridVids
Sign in with YouTube

Coding Adventure: Rubik's Cube

Sebastian Lague May 7, 2026 10:00
Create an account to hide videos, mark them watched, or save them to Don't Miss.
Don't Miss
Create an account to hide videos, mark them watched, or save them to Don't Miss.
Mark watched
Create an account to hide videos, mark them watched, or save them to Don't Miss.
Hide
Open in popup Open on YouTube
Share video

Share video

Copy the GridVids link or iframe code.

Video link
Iframe code
Iframe content

Chapters
My attempt at solving the 3x3 Rubik's cube (by programming the computer to do it for me). Note: in the evaluation function at 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): https://www.patreon.com/SebastianLague Source code: https://github.com/SebLague/Rubiks-Cube Follow-up video: https://youtu.be/Eysf6-E3ino?is=Fu6gW1WFUXyDTQoa Resources and credits: https://en.wikipedia.org/wiki/Optimal_solutions_for_the_Rubik%27s_Cube https://raw.githubusercontent.com/SebLague/Misc-Project-Info/refs/heads/main/Coding-Adventures/RubiksCube.txt Chapters:
Entertainment