Skip to content

Solving Cubot

Akshath Raghav edited this page Jul 4, 2021 · 3 revisions

solve()

--> Solves the cube and returns the solution.

Returns a warning along with the solution as well on how to fix the issue if the cube

  1. has been incorrectly entered,
  2. has an edge flipped,
  3. has a corner flipped
Cubot cube = new Cubot(true);
// "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

System.out.println(cube.solve());
// solves

Example

The output is not formatted, and has no newline characters. Keep this in mind while using it.


isSolved()

--> tells you if its solved

Cubot cube = new Cubot(true);
// "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

System.out.println(cube.solve());
// solves

This ⬆️ returns false