Revision 522d858e
Added by Leszek Koltunski about 1 year ago
src/main/java/org/distorted/objectlib/tablebases/TablebasesSkewbDiamond.java | ||
---|---|---|
104 | 104 |
return 138240; // see https://www.jaapsch.net/puzzles/diamond.htm |
105 | 105 |
} |
106 | 106 |
|
107 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
108 |
|
|
109 |
private int computeCenterQuat(int originalLocation, int newLocation) |
|
110 |
{ |
|
111 |
return 0; |
|
112 |
} |
|
113 |
|
|
114 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
115 |
|
|
116 |
private int computeCornerQuat(int originalLocation, int newLocation, int twist) |
|
117 |
{ |
|
118 |
return 0; |
|
119 |
} |
|
120 |
|
|
121 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
122 |
|
|
123 |
private int[] computeCenterPerm(int q0, int q1, int q2, int q3) |
|
124 |
{ |
|
125 |
return null; |
|
126 |
} |
|
127 |
|
|
128 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
129 |
|
|
130 |
private int computeCornerPerm(int[] output, int[] quats) |
|
131 |
{ |
|
132 |
return 0; |
|
133 |
} |
|
134 |
|
|
107 | 135 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
108 | 136 |
|
109 | 137 |
public int[] getQuats(int index) |
110 | 138 |
{ |
111 |
return new int[] {0,0,0,0,0,0, 0,0,0,0,0,0,0,0}; |
|
139 |
int centers_perm_num = (index%12); |
|
140 |
index /= 12; |
|
141 |
int totalTwist = (index%128); |
|
142 |
int corners_perm_num = (index/128); |
|
143 |
|
|
144 |
int[] centers_perm = new int[4]; |
|
145 |
TablebaseHelpers.getEvenPermutationFromNum(centers_perm,centers_perm_num); |
|
146 |
int[] corners_perm = new int[6]; |
|
147 |
TablebaseHelpers.getEvenPermutationFromNum(corners_perm,corners_perm_num); |
|
148 |
|
|
149 |
int[] quats = new int[14]; |
|
150 |
|
|
151 |
for(int i=0; i<6; i++) |
|
152 |
{ |
|
153 |
int twist = (totalTwist%2); |
|
154 |
totalTwist /= 2; |
|
155 |
quats[i] = computeCornerQuat(i,corners_perm[i],twist); |
|
156 |
} |
|
157 |
|
|
158 |
quats[ 6] = computeCenterQuat(0,centers_perm[0]); |
|
159 |
quats[ 8] = computeCenterQuat(1,centers_perm[1]); |
|
160 |
quats[11] = computeCenterQuat(2,centers_perm[2]); |
|
161 |
quats[13] = computeCenterQuat(3,centers_perm[3]); |
|
162 |
|
|
163 |
return quats; |
|
112 | 164 |
} |
113 | 165 |
|
114 | 166 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
115 | 167 |
|
116 | 168 |
public int getIndex(int[] quats) |
117 | 169 |
{ |
118 |
return 0; |
|
170 |
int[] center_perm = computeCenterPerm(quats[6],quats[8],quats[11],quats[13]); |
|
171 |
int centers_perm_num = TablebaseHelpers.computeEvenPermutationNum(center_perm); |
|
172 |
int[] corners_perm = new int[6]; |
|
173 |
int totalTwist = computeCornerPerm(corners_perm,quats); |
|
174 |
int corners_perm_num = TablebaseHelpers.computeEvenPermutationNum(corners_perm); |
|
175 |
|
|
176 |
return centers_perm_num + 12*(totalTwist + 128*corners_perm_num); |
|
119 | 177 |
} |
120 | 178 |
} |
121 | 179 |
|
Also available in: Unified diff
Progress with the Diamond Skewb solver.