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

Class SkewbFCN

app/src/main/java/solver/SkewbFCN.java:5–242  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3import java.util.Random;
4
5public class SkewbFCN {
6 private static short[][] ctm = new short[360][4];
7 private static short[][] cpm = new short[36][4];
8 private static short[][] com = new short[2187][4];
9 private static byte[] ctd = new byte[360];
10 private static byte[] cd = new byte[2187 * 36];
11 private static Random r = new Random();
12 //private static int[] seq = new int[12];
13
14 static {
15 // move tables
16 /* center
17 * 0
18 * 4 1 2 3
19 * 5
20 */
21 int[] arr = new int[7];
22 for (int i = 0; i < 360; i++)
23 for (int j = 0; j < 4; j++) {
24 Utils.idxToPerm(arr, i, 6, true);
25 switch (j) {
26 case 0: Utils.circle(arr, 2, 5, 3); break; //R
27 case 1: Utils.circle(arr, 0, 3, 4); break; //U
28 case 2: Utils.circle(arr, 1, 4, 5); break; //L
29 case 3: Utils.circle(arr, 3, 5, 4); break; //B
30 }
31 ctm[i][j] = (short) Utils.permToIdx(arr, 6, true);
32 }
33 /* corner permutation
34 * 2-0
35 * 0 1
36 * 3
37 * 2-1 2-2
38 * 2
39 */
40 //corner permutation
41 int[] arr2 = new int[3];
42 for (int i = 0; i < 12; i++)
43 for (int j = 0; j < 3; j++) {
44 for (int k = 0; k < 4; k++) {
45 Utils.idxToPerm(arr, i, 4, true);
46 Utils.idxToPerm(arr2, j, 3, true);
47 switch (k) {
48 case 0: Utils.circle(arr, 1, 2, 3); break; //R
49 case 1: Utils.circle(arr, 0, 1, 3); break; //U
50 case 2: Utils.circle(arr, 2, 0, 3); break; //L
51 case 3: Utils.circle(arr2, 0, 2, 1); break; //B
52 }
53 cpm[i * 3 + j][k] = (short) (Utils.permToIdx(arr, 4, true) * 3 + Utils.permToIdx(arr2, 3, true));
54 }
55 }
56 //corner orientation
57 /*
58 * 0
59 * 1 2
60 * 3
61 * 4 5
62 * 6

Callers

nothing calls this directly

Calls 6

idxToPermMethod · 0.95
circleMethod · 0.95
permToIdxMethod · 0.95
idxToOriMethod · 0.95
oriToIdxMethod · 0.95
createPrunMethod · 0.95

Tested by

no test coverage detected