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

Method scramble

app/src/main/java/solver/Domino.java:75–93  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

73 }
74
75 public static String scramble() {
76 init();
77 Random r = new Random();
78 int cp = r.nextInt(40320);
79 int ep = r.nextInt(40320);
80
81 for (int d = 0; d < 19; d++) {
82 if (search(cp, ep, d, -1)) {
83 if (d < 2) return scramble();
84 if (d < 4) continue;
85 StringBuilder s = new StringBuilder();
86 for (int i = 1; i <= d; i++) {
87 s.append(turn[seq[i] / 3]).append(suffInv[seq[i] % 3]).append(' ');
88 }
89 return s.toString();
90 }
91 }
92 return "error";
93 }
94
95 private static int[] img = new int[42];
96 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