MCPcopy Create free account
hub / github.com/MeigenChou/DCTimer-Android / solution

Method solution

app/src/main/java/cs/min2phase/Search.java:96–106  ·  view source on GitHub ↗
(String facelets, boolean rotate, Random r)

Source from the content-addressed store, hash-verified

94 public static char[] rotateIdx = {0, 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'D', 'D', 'D'};
95
96 public synchronized String solution(String facelets, boolean rotate, Random r) {
97 String sol = solution(facelets, 21, 10000, 0, 2);
98 if (!rotate) return sol;
99 String[] moves = sol.split(" ");
100 char lastMove = moves[moves.length - 1].charAt(0);
101 int rot;
102 do {
103 rot = r.nextInt(24);
104 } while (rotateIdx[rot] == lastMove);
105 return sol + rotateStr[rot];
106 }
107
108 /**
109 * Computes the solver string for a given cube.

Callers 3

searchMethod · 0.45
generateScrambleMethod · 0.45
scramble333Method · 0.45

Calls 5

toCubieCubeMethod · 0.95
initMethod · 0.95
initSearchMethod · 0.95
searchMethod · 0.95
searchOptMethod · 0.95

Tested by

no test coverage detected