An AI taught me to solve a Rubik's cube!

michaelg

Member
Joined
Mar 22, 2026
Messages
12
Location
Boston
I wanted to see how far I could take vibe-apping - having an AI write an entire app without me looking at the code. Being a software guy with an Apple developer license, I am in a good position for this. After I let Gemini Flash (much preferred over Claude) build a soma cube solver (https://somacube.web.app/), it suggested more people might be interested in a Rubik's cube solver, could it build one for me? I had never handled a cube before, but I bought one and said "sure".

Gemini started by building an app that scanned my physical cube with a phone camera and gave me a step-by-step Kociemba solution (
). Once I learned the basic move terminology I was able to follow along and solve my cube. But I couldn't solve it myself. This is pretty typical of my vibe-apping experience. If you're not absolutely specific about what you want, the AI is going to do something unexpected. I told Gemini "I want to be able to solve this ON MY OWN."

Gemini suggested I learn LBL. It built a step-by-step solver for my cube and a tutorial. I learned white cross and the rest of LBL and could now solve the cube myself. "What's next I asked?"

Gemini thought I should learn to solve in fewer steps. It taught me about CFOP, built a CFOP step-by-step solver for my cube and a tutorial. I learned to do an advanced white-cross on the bottom, F2L, and two-layer OLL and PLL. On my own, albeit slowly.

But Gemini still hasn't been able to teach me Kociemba. It tried a pattern-matching tutorial, but that didn't work for me. I am going to keep playing around and would sure appreciate ideas about where to take this next. If you want to check out the project so far, it is here:

I've also used Gemini to rewrite a couple of my other iPhone apps and it added some nice features that I didn't want to spend the time to do myself. Like a HUD display for my navigation app Wheresit. All in all, my experience thus far is that AI coding is just as game-changing as the invention of Basic or C or the creation of object-oriented programming. If I was dependent on coding skills to make a living, I'd be doing more than just playing around with this!
 
Did it implement a Kociemba solver itself just from a description of the algorithm? Or did it use someone else's code? In the latter case, did it respect its license?
 
roux?
ZZ variants?
WInter Variation algs?

What about this for a 2x2?

Finally an AI that can solve a cube? (many posts here were unsuccessful suggestions, but don't think anyone tried to vibe an app....)
 
But Gemini still hasn't been able to teach me Kociemba.

If you want to know more about human solving and especially computer solving, I recommend reading this article.

What's next I asked?

Along with suboptimal solver (regardless whether computer or human method based), one idea is adding an optimal solver (depends on what your target audience is).


P.S. if you like Soma cube and now that you can solve Rubik´s cube, you might also like solving Rubik´s Tetris.

P.S.2 based on the screenshots from https://apps.apple.com/us/app/speedcube-ar-3x3-cube-solver/id6760368416 and the description "PRO FEATURES: Physical cube scanning, detailed solution analysis, and unlock advanced 50-move scrambles." I would assume you are using a sequence of random moves with adjustable length to scramble the cube. I know it can be rather unintuitive for Rubik´s cube beginners, but without going into details, this is considered a bad practice (among speed cubers, at least). We (speed cubers) are actually using a random cube state instead to scramble the cube.
 
Last edited:
Did it implement a Kociemba solver itself just from a description of the algorithm? Or did it use someone else's code? In the latter case, did it respect its license?
Here is what Gemini says about its Kociemba solver:

Because this is a custom port of a public algorithm (Herbert Kociemba's 1992 Two-Phase Algorithm), it generally falls under the following context:
  • The Algorithm: The mathematical "Two-Phase Algorithm" itself was published by Herbert Kociemba and is widely used in the cubing community.
  • The Code: The specific Dart code in your repository is a custom implementation.
 
roux?
ZZ variants?
WInter Variation algs?

What about this for a 2x2?

Finally an AI that can solve a cube? (many posts here were unsuccessful suggestions, but don't think anyone tried to vibe an app....)

Gemini suggests that the next logical step to reducing my move count is to learn Roux. I'm having it write a solver and tutorial now.
 
If you want to know more about human solving and especially computer solving, I recommend reading this article.



Along with suboptimal solver (regardless whether computer or human method based), one idea is adding an optimal solver (depends on what your target audience is).


P.S. if you like Soma cube and now that you can solve Rubik´s cube, you might also like solving Rubik´s Tetris.

P.S.2 based on the screenshots from https://apps.apple.com/us/app/speedcube-ar-3x3-cube-solver/id6760368416 and the description "PRO FEATURES: Physical cube scanning, detailed solution analysis, and unlock advanced 50-move scrambles." I would assume you are using a sequence of random moves with adjustable length to scramble the cube. I know it can be rather unintuitive for Rubik´s cube beginners, but without going into details, this is considered a bad practice (among speed cubers, at least). We (speed cubers) are actually using a random cube state instead to scramble the cube.
Thanks for the feedback on starting with a random cube state. I'll have Gemini implement that!
 
roux?
ZZ variants?
WInter Variation algs?

What about this for a 2x2?

Finally an AI that can solve a cube? (many posts here were unsuccessful suggestions, but don't think anyone tried to vibe an app....)
working on roux now. solver is working, tutorial still needs improvement.
 
What do you think John, was Gemini lying or did it write its own code? I don't know about Kociemba, but for the others it appears to be working from descriptions of algorithms.
I don't know. I tried to find some of its variable names and comments elsewhere in order to possibly find similar code, but wasn't really successful. It's possible that it did write the code just from the description and a general "knowledge" of how to write such solvers without "copying" someone's code, but I still think that's a tricky thing to get right, so I remain doubtful. Maybe I just didn't search well enough. Anyway I myself would certainly not trust it and publish something with it. I'd either implement it myself, or, more likely, use someone else's library as permitted.
 
I don't know. I tried to find some of its variable names and comments elsewhere in order to possibly find similar code, but wasn't really successful. It's possible that it did write the code just from the description and a general "knowledge" of how to write such solvers without "copying" someone's code, but I still think that's a tricky thing to get right, so I remain doubtful. Maybe I just didn't search well enough. Anyway I myself would certainly not trust it and publish something with it. I'd either implement it myself, or, more likely, use someone else's library as permitted.
Vibe coding certainly makes code maintenance "throw it away and rewrite it". Puts a lot of reliance on the test suite.
 
Back
Top