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

Method scramble

app/src/main/java/solver/Tower.java:80–98  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

78 }
79
80 public static String scramble() {
81 init();
82 Random r = new Random();
83 int cp = r.nextInt(40320);
84 int ep = r.nextInt(6);
85 for (int d = 0; d < 20; d++) {
86 if (search(cp, ep, d, -1)) {
87 if (d < 2) return scramble();
88 if (d < 4) {
89 continue;
90 }
91 StringBuilder sb = new StringBuilder();
92 for (int i = 1; i <= d; i++)
93 sb.append(turn[seq[i] / 3]).append(suffInv[seq[i] % 3]).append(" ");
94 return sb.toString();
95 }
96 }
97 return "error";
98 }
99
100 private static int[] img = new int[32];
101 private static void initColor() {

Callers 1

generateScrambleMethod · 0.95

Calls 3

initMethod · 0.95
searchMethod · 0.95
toStringMethod · 0.80

Tested by

no test coverage detected