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

Method edgemv2

app/src/main/java/solver/Roux.java:186–213  ·  view source on GitHub ↗
(int c, int p, int o, int f)

Source from the content-addressed store, hash-verified

184 }
185
186 private static int edgemv2(int c, int p, int o, int f) {
187 int[] n = new int[9], s = new int[3];
188 Utils.idxToPerm(s, p, 3, false);
189 int t, q = 3;
190 for (t = 0; t < 9; t++)
191 if (c >= Utils.Cnk[8 - t][q]) {
192 c -= Utils.Cnk[8 - t][q--];
193 n[t] = s[q] << 1 | o & 1;
194 o >>= 1;
195 } else n[t] = -1;
196 switch (f) {
197 case 0: //U
198 Cross.circle(n, 0, 1, 2, 3, 0); break;
199 case 1: //r
200 Cross.circle(n, 0, 2, 4, 5, 1);
201 case 2: //R
202 Cross.circle(n, 1, 6, 7, 8, 0); break;
203 }
204 c = o = 0; q = 3;
205 for (t = 0; t < 9; t++)
206 if (n[t] >= 0) {
207 c += Utils.Cnk[8 - t][q--];
208 s[q] = n[t] >> 1;
209 o |= (n[t] & 1) << 2 - q;
210 }
211 p = Utils.permToIdx(s, 3, false);
212 return 6 * c + p << 3 | o;
213 }
214
215 private static int cornmv2(int c, int po, int f) {
216 int[] n = new int[6], s = new int[4];

Callers 1

initr2Method · 0.95

Calls 3

idxToPermMethod · 0.95
circleMethod · 0.95
permToIdxMethod · 0.95

Tested by

no test coverage detected