| 60 | private static String[] turn = {"U", "R"}; |
| 61 | private static String[] turnlu = {"U", "L"}; |
| 62 | private static boolean search(int cp, int co, int ep, int depth, int lm) { |
| 63 | if (depth == 0) return cp == 0 && co == 0 && ep == 0; |
| 64 | if (cd[cp * 243 + co] > depth || epd[ep] > depth) return false; |
| 65 | for (int i = 0; i < 2; i++) { |
| 66 | if (i != lm) { |
| 67 | int d = cp, w = co, y = ep; |
| 68 | for (int j = 0; j < 3; j++) { |
| 69 | d = cpm[d][i]; w = com[w][i]; y = epm[y][i]; |
| 70 | if (search(d, w, y, depth - 1, i)) { |
| 71 | seq[depth] = i * 3 + j; |
| 72 | //sb.insert(0, turn[i] + suff[j]+" "); |
| 73 | return true; |
| 74 | } |
| 75 | } |
| 76 | } |
| 77 | } |
| 78 | return false; |
| 79 | } |
| 80 | |
| 81 | public static String scramble(boolean lu) { |
| 82 | int cp, co, ep; |