Skip to content

Executing Moves

Akshath Raghav edited this page Jun 28, 2021 · 8 revisions

stringalg(String s)

--> Executes the moves given as s.

Make sure that the input is separated by spaces, otherwise, Cubot will not execute the moves.

Cubot cube = new Cubot() ; 
System.out.println("Cube state == Solved ? --> " + cube1.isSolved());
System.out.println("------------------------------------------");
System.out.println("Moves Carried Out by stringalg() : " + cube1.stringalg("R U R' U'") );
System.out.println("------------------------------------------");
System.out.println("Cube state == Solved ? --> " + cube1.isSolved());

example

reverseAlg(String s, boolean check)

--> reverses all the moves done ( s represents the moves executed ) if check is true, returns reversed String otherwise

Make sure that the input is separated by spaces, otherwise, Cubot will not execute the moves.

Cubot cube = new Cubot();

String s = "R U R' U'" ;
System.out.println("Moves : " + cube.reversealg(s, false)) ; // just reverses it
System.out.println("Cube State : " + cube.isSolved());
System.out.println();
System.out.println("Moves : " +cube.reversealg(s, true)) ; // just reverses it
System.out.println("Cube State : " + cube.isSolved());

example

Clone this wiki locally