()
| 120 | } |
| 121 | |
| 122 | public static String scramble() { |
| 123 | int ct = r.nextInt(360), cp, co; |
| 124 | do { |
| 125 | cp = r.nextInt(36); |
| 126 | co = r.nextInt(2187); |
| 127 | } while (cd[co * 36 + cp] < 0); |
| 128 | int[] seq = new int[12]; |
| 129 | for (int d = 0; d < 12; d++) |
| 130 | if (search(ct, cp, co, d, -1, seq)) { |
| 131 | if (d < 2) return scramble(); |
| 132 | if (d < 4) { |
| 133 | continue; |
| 134 | } |
| 135 | StringBuilder sol = new StringBuilder(); |
| 136 | for (int i = 1; i <= d; i++) |
| 137 | sol.append(turn[seq[i] >> 1]).append(suff[seq[i] & 1]).append(" "); |
| 138 | return sol.toString(); |
| 139 | } |
| 140 | return "error"; |
| 141 | } |
| 142 | |
| 143 | private static String scramble(int minLen) { |
| 144 | int ct = r.nextInt(360), cp, co; |
no test coverage detected