()
| 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() { |
no test coverage detected