I am pretty sure there are quite a lot of Rubik's Cube solver. My goal is not to bring a revolutionary new tool, but to learn Python doing it without using existing Python cube solvers like RubikOptimal or rubik-solver.
I hope this project will evolve towards a camera-based solution to avoid entering manually all the colors.
python -m pip install -r requirements.txt
This first version is 100% command lines. You need to enter all the colors of your cube in the right order, after placing the cube with blue face towards you, and white face on top.
Note
Here is the order you will be asked to follow :
- Blue / Front
- Red / Right
- Orange / Left
- Green / Back
- White / Upper
- Yellow / Down
Important
Looking at the cube, colors should be given from top-left to bottom-right:
1 2 3
4 5 6
7 8 9
In order to facilitate face rotation computation, I opted for a numerical representation of the cube:
That way, I am able to list all the adjacent cells, so none are forgotten during face rotation:
Now a face rotation will be computed as a characters permutation depending on what face is involved.