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

Method search

app/src/main/java/solver/CubeRU.java:62–79  ·  view source on GitHub ↗
(int cp, int co, int ep, int depth, int lm)

Source from the content-addressed store, hash-verified

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;

Callers 1

scrambleMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected