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

Method move

app/src/main/java/solver/EightPuzzle.java:52–62  ·  view source on GitHub ↗
(int m)

Source from the content-addressed store, hash-verified

50 }
51
52 private static int move(int m) {
53 int pos = 0;
54 for (; pos < 9; pos++) {
55 if (pz[pos] == 8) break;
56 }
57 int next = moveIdx[pos][m];
58 if (next != -1) {
59 Utils.swap(pz, pos, next);
60 }
61 return next;
62 }
63
64 static boolean search(int state, int d) {
65 if (d == 0) return state == 0;

Callers 2

initMethod · 0.95
searchMethod · 0.95

Calls 1

swapMethod · 0.95

Tested by

no test coverage detected