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

Method search

app/src/main/java/solver/Floppy.java:53–68  ·  view source on GitHub ↗
(int cp, int eo, int d, int lm)

Source from the content-addressed store, hash-verified

51 }
52
53 private static boolean search(int cp, int eo, int d, int lm) {
54 if (d == 0) return cp == 0 && eo == 0;
55 if (distance[cp][eo] > d) return false;
56 for (int i = 0; i < 4; i++) {
57 if (i != lm) {
58 int cpi = permMove(cp, i);
59 int eoi = flipMove(eo, i);
60 if (search(cpi, eoi, d - 1, i)) {
61 seq[d] = i;
62 //sb.insert(0, turn[i] + " ");
63 return true;
64 }
65 }
66 }
67 return false;
68 }
69
70 public static String scramble() {
71 Random r = new Random();

Callers 1

scrambleMethod · 0.95

Calls 2

permMoveMethod · 0.95
flipMoveMethod · 0.95

Tested by

no test coverage detected