- Virtually construct a Cube ( 2x2/3x3 ),
- Quickly execute moves and perform algorithms seamlessly,
- Manipulate the Cube using simple java,
- Get the solution for the cube
- Use a cube in your own projects
There are many Rubik's Cube-related graphic projects and solvers which implement various algorithms for solving the cube.
But programmers might not want something just for visualizing the cube, they might want a data-structure kind of solution for them to use in their own projects without having to make their own classes. Perhaps they want to only execute moves and compare cubes with the help of a library. Boom, Cubot enters the chat
- Virtually construct a Cube ( 2x2/3x3 ),
- Quickly execute moves and perform algorithms seamlessly,
- Manipulate the Cube using simple java,
- Get the solution for the cube
- Use a cube in your own projects
- and so much more, with the help of the methods it provides
Now speed is relative, as we all know. But Cubot can scramble the Cube, print, solve the Cube, print, bring the cube back into the scrambled state and print again, in less than a second on average.
long startTime = System.nanoTime();
Cubot cube = new Cubot();
// "U2 F2 D2 U R' D2 B2 U L2 B' D' U2 F L F U' B' R' F' U F' U B L' D2 B R' B F2 R'" --> Offical WCA Scramble
cube.stringAlg("U2 F2 D2 U R' D2 B2 U L2 B' D' U2 F L F U' B' R' F' U F' U B L' D2 B R' B F2 R'") ;
// scrambles
Cubot cube2 = new Cubot(cube.cubeToArr()) ;
System.out.println(cube);
// prints output
String s = cube.solve() ;
// solves
System.out.println(cube);
// prints ouput
System.out.println();
cube.reverseAlg(s, true) ;
// rescrambles with the solve again
System.out.println(cube);
// prints output
System.out.println("Re-scrambled ? = " + ((Cube3) cube.getCube()).solved((Cube3) cube2.getCube())) ;
// checks if the rescrambled cube is the same as the first scramble
long endTime = System.nanoTime();
long time = (endTime - startTime) ;
System.out.println("-----------------------------");
System.out.println("Execution time in milliseconds: " + time / 1000000);
Head over to the Docs for more on Cubot and how to use it
- Download the Cubot.jar (v2.0)
- Go to your project on Intellij or Eclipse
- Click on Files on the top left corner, and then click on Project Structure
4. Now click on the Libraries option, and then choose the "+" button as shown in the image
5. You will get 3 options. Choose Java and then select Cubot.jar from the download location
- getScramble(int n) added; reverseAlg(String s) added; minor tweaks in Checker - 30.5.2021
- E(), S() added, updated Moves in moves - 31.5.2021
- Edash(), Sdash(), x(), y(), y'() + Optimized the big slice moves; solve(), stringalg(), reversealg() updated - 1.6.2021
- toString() improved to make it much easier to understand the cube-state ( check out the new output in Documentation ) - 2.6.2021
- Cube constructor updated ( Enter cube faces randomly now ) - 3.6.2021
- toString() bug fixed, pll() bug fixed- 11.6.2021
- 2x2 files added, 3x3 files made sep - 14.6.2021
- Merged src added, use single Cubot for both Cubes, Documentation and README updated - 15.6.2021
- cubeToString added for 2x2 - 22.6.2021
- cubeToString added to Cubot for both 2x2 and 3x3 - 25.6.2021
- wiki added for the repo, files updated, cubeToArr, toString, etc fixed - 28.6.2021
- documentation for 2x2 files done - 1.7.2021
- 2x2 solver added and documented - 2.7.2021
- 3x3 classes documented - 7.7.2021
- v2.0 published - 11.7.2021