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

Method initCt

app/src/main/java/cs/threephase/Center2.java:46–87  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

44 }
45
46 public static void initCt() {
47 Center2 c = new Center2();
48 for (int i = 0; i < 6435; i++) {
49 c.setct(i);
50 for (int j = 0; j < 16; j++) {
51 ctrot[i][j] = (char) c.getct();
52 c.rot(0);
53 if ((j & 1) == 1) c.rot(1);
54 if ((j & 7) == 7) c.rot(2);
55 }
56 }
57 for (int i = 0; i < 6435; i++) {
58 for (int m = 0; m < 28; m++) {
59 c.setct(i);
60 c.move(move2std[m]);
61 ctmv[i][m] = (char) c.getct();
62 }
63 }
64 Arrays.fill(ctprun, (byte)-1);
65 ctprun[0] = ctprun[18] = ctprun[28] = ctprun[46] = ctprun[54] = ctprun[56] = 0;
66 int depth = 0;
67 int done = 6;
68 while (done != 6435 * 35 * 2) {
69 for (int i = 0; i < 6435 * 35 * 2; i++) {
70 if (ctprun[i] == depth) {
71 int ct = i / 70;
72 int rl = i % 70;
73 for (int m = 0; m < 23; m++) {
74 int ctx = ctmv[ct][m];
75 int rlx = rlmv[rl][m];
76 int idx = ctx * 70 + rlx;
77 if (ctprun[idx] == -1) {
78 ctprun[idx] = (byte)(depth+1);
79 done++;
80 }
81 }
82 }
83 }
84 depth++;
85// System.out.println(String.format("%2d%10d", depth, done));
86 }
87 }
88
89 Center2() {
90

Callers 1

initMethod · 0.95

Calls 4

setctMethod · 0.95
getctMethod · 0.95
rotMethod · 0.95
moveMethod · 0.95

Tested by

no test coverage detected