I wanted to build a rubix cube scrambler and then a bot to solve it. Heres how I did it.
RoboCube is a browser-based 3D Rubik's Cube scrambler and solver. It
renders an interactive cube with Three.js, lets you build up scrambles
in batches, and solves the current cube state with a Kociemba two-phase
solver through cubejs.
I wanted to build something fun to relax my brain from my big project. I think this prototype has real value. You could add more cube sizes, give more detailed explinations to turn this into a teaching tool.
The best part about this build was switching from claude to codex at the end. Claude and I built and codex shipped it. The process of asking codex to start where claude left off was quite smooth.
If you want to clone and use the repo to build with go for it! The design html has features that could be added if you want to continue building this out!
Tech stack
- Claude Code
- Codex
Links
Prompt steps
Step 1
We are building a rubix cube scrambler and a bot to solve it. We need to build a design document. We need graphics to generate a rubix cube in our HTML file. Then we need to plan out a few buttons. Scramble and reset and solve. Then plan the features we need to scramble the cube when the user presses scramble and we need a reset function. The solve function needs to be planned, How will the bot know to solve? What training data do we need to find.Step 2
The design doc is located: “” We planned out the first few feature, lets start by adding the virtual display only. Add the buttons and rubix cube to the screen and make it look nice pleaseStep 3
Ui looks nice, Now lets add the button functions to the cube! The buttons dont work, the scramble does show moves being made but the cube is still default. Solve button also doesnt solve the cubeStep 4
Amazing. Now we have a cube,working buttons, Clean UI and a “Solve” that does the moves in reverse to demo the process as working. Next, In the design.html we listed a few ways to solve the rubix cube. Lets do the hybrid approach of using Kociemba's algorithm or CFOP layer-by-layerStep 5
Pressing scrable should multiple times will increase the move set instead of resetting. if we need a max moves count for prototype set at 420 moves. Also since Kociemba is solving, can we have text pop on the screen showing why it did what it did and explain how the pattern works? Showing you how to solve this move set?Step 6
I cleared my cache so I made a prompt. Note, im experimenting that claude reading txt files costs less tokens then typing a prompt. So this prompt is really just “Read this prompt “Path to file.” Nothings confirmed, just a theory.Step 7
So this is where I ran out of tokens on my account. I open codex and gave this as a prompt. Hey! Claude needs a break so I hope you can help. Read the prompt.txt file, then this is the last thing claude did before stopping.Step 8
After that the file was complete. The rest of the prompts I used polished up the UI, readme, and helped me write this post itself! One of which was using codex to rename everything robocube :)
18 likes · 8 comments · 7 views
Comments (4)
This is sick, could even teach people how to solve rubiks cubes quicker. Why the switch from Claude to Codex at the end, anything specific?
I ran out of tokens so I switched over in the end!
That’s a really clean combo — Three.js + a Kociemba solver is such a solid approach.
Thanks!!!
Turning this into a teaching tool with step-by-step solves would make it super valuable.
True true, might look into that somewhen!
A 3D interactive cube in the browser is already cool, adding different cube sizes would take it to another level.
Claude made that FIRST try. Spinning and everything. I was pretty shocked. No doubt it can generate bigger ones.