-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMove.txt
More file actions
58 lines (50 loc) · 2.11 KB
/
Move.txt
File metadata and controls
58 lines (50 loc) · 2.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
public class Move {
public final int[] cpPerm; // Corner permutation
public final int[] coDelta; // Corner orientation delta
public final int[] epPerm; // Edge permutation
public final int[] eoDelta; // Edge orientation delta
public Move(int[] cpPerm, int[] coDelta, int[] epPerm, int[] eoDelta) {
this.cpPerm = cpPerm;
this.coDelta = coDelta;
this.epPerm = epPerm;
this.eoDelta = eoDelta;
}
// Predefined moves
public static final Move U = new Move(
new int[]{3, 0, 1, 2, 4, 5, 6, 7},
new int[]{0, 0, 0, 0, 0, 0, 0, 0},
new int[]{3, 0, 1, 2, 4, 5, 6, 7, 8, 9, 10, 11},
new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
);
public static final Move D = new Move(
new int[]{1, 2, 3, 0, 4, 5, 6, 7},
new int[]{0, 0, 0, 0, 0, 0, 0, 0},
new int[]{1, 2, 3, 0, 4, 5, 6, 7, 8, 9, 10, 11},
new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
);
// Additional moves (L, R, F, B, and their inverses and double turns) would be defined similarly
public static final Move L = new Move(
new int[]{0, 1, 2, 3, 4, 5, 6, 7},
new int[]{0, 0, 0, 0, 0, 0, 0, 0},
new int[]{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11},
new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
);
public static final Move R = new Move(
new int[]{0, 1, 2, 3, 4, 5, 6, 7},
new int[]{0, 0, 0, 0, 0, 0, 0, 0},
new int[]{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11},
new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
);
public static final Move F = new Move(
new int[]{0, 1, 2, 3, 4, 5, 6, 7},
new int[]{0, 0, 0, 0, 0, 0, 0, 0},
new int[]{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11},
new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
);
public static final Move B = new Move(
new int[]{0, 1, 2, 3, 4, 5, 6, 7},
new int[]{0, 0, 0, 0, 0, 0, 0, 0},
new int[]{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11},
new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
);
}