MCPcopy Index your code
hub / github.com/MeigenChou/DCTimer-Android / RouxMU

Class RouxMU

app/src/main/java/solver/RouxMU.java:9–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7import static solver.Utils.suffInv;
8
9public class RouxMU {
10 private static short[][] epm = new short[720][2];
11 private static short[][] eom = new short[32][2];
12 private static short[][] ctm = {{1, 0}, {2, 1}, {3, 2}, {0, 3}};
13 private static short[][] cpm = {{0, 1}, {1, 2}, {2, 3}, {3, 0}};
14 private static byte[] ed = new byte[720 * 32];
15 private static byte[] eod = new byte[32 * 16];
16 private static String[] turn = {"M", "U"};
17 private static int[] seq = new int[21];
18
19 static {
20 int i, j;
21 int[] temp = new int[6];
22 for (i = 0; i < 720; i++) {
23 for (j = 0; j < 2; j++) {
24 Utils.idxToPerm(temp, i, 6, false);
25 switch (j) {
26 case 0: Utils.circle(temp, 0, 4, 5, 2); break;
27 case 1: Utils.circle(temp, 0, 3, 2, 1); break;
28 }
29 epm[i][j] = (short) Utils.permToIdx(temp, 6, false);
30 }
31 }
32 for (i = 0; i < 32; i++) {
33 for (j = 0; j < 2; j++) {
34 Utils.idxToFlip(temp, i, 6, true);
35 switch (j) {
36 case 0: Utils.circle(temp, 0, 4, 5, 2);
37 temp[0] = 1 - temp[0];
38 temp[2] = 1 - temp[2];
39 temp[4] = 1 - temp[4];
40 temp[5] = 1 - temp[5];
41 break;
42 case 1: Utils.circle(temp, 0, 3, 2, 1); break;
43 }
44 eom[i][j] = (short) Utils.flipToIdx(temp, 6, true);
45 }
46 }
47
48 for (i = 0; i < 23040; i++) ed[i] = -1;
49 ed[0] = 0;
50 Utils.createPrun(ed, 14, epm, eom, 3);
51 for (i = 0; i < 512; i++) eod[i] = -1;
52 eod[0] = 0;
53 int c = 1;
54 for (int d = 0; d < 12; d++) {
55 //c = 0;
56 for (i = 0; i < 32; i++)
57 for (j = 0; j < 16; j++)
58 if (eod[i * 16 + j] == d)
59 for (int k = 0; k < 2; k++) {
60 int y = i, t = j;
61 for (int m = 0; m < 3; m++) {
62 y = eom[y][k];
63 t = ctm[t / 4][k] * 4 + cpm[t % 4][k];
64 if (eod[y * 16 + t] < 0) {
65 eod[y * 16 + t] = (byte) (d + 1);
66 c++;

Callers

nothing calls this directly

Calls 6

idxToPermMethod · 0.95
circleMethod · 0.95
permToIdxMethod · 0.95
idxToFlipMethod · 0.95
flipToIdxMethod · 0.95
createPrunMethod · 0.95

Tested by

no test coverage detected