Inspiration

My inspiration for this project was me messing around with a rubiks cube in the CS Lab. I spent some trying to figure out how to solve the cube and thought about if I could make a solve online.

What it does

The project displays a rubiks cube, and scrambles it. After scrambling it there are 2 buttons. One is a complete solve which solves the entire cube at once, and the other is a next button which solves the next "major" step in solving the cube. The entire thing is shown in 3d via 3js

How we built it

The entire project was built in javascript. it uses the 3JS module to make the 3d cube. There is a Cube class which contains an array of blocks which is its own class. any move on the cube takes the members from the array and shifts them through the array. After this there is a Solve class which takes a Cube and figures out the moves that need to be done to solve it. The cube class has a parseMoves function which takes these moves and does the rotations.

Challenges we ran into

The biggest challenge was internally storing the cube. It took a really long time to figure out how the cube was stored, and how moving a side would affect the cube. Moving any side on a cube affects 5 faces on the cube which was very hard to think about.

Accomplishments that we're proud of

I am proud of my A* implementation for solving the bottom cross in the fewest possible moves

What we learned

I learnt how to implement A*. I also learnt how to use 3JS to make 3d projects

What's next for Rubiks Cube Solver

Next up is getting the back button to go back a step. I wanted to implement this, but did not have the time. Another thing I want to work on is expanding the reach of A* so that it also finds the best pair to solve to reduce the number of moves needed to solve the cube even more.

Built With

Share this project:

Updates