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

Method solveXcrossf

app/src/main/java/solver/Cross.java:428–480  ·  view source on GitHub ↗
(String scramble)

Source from the content-addressed store, hash-verified

426 }
427
428 public static String solveXcrossf(String scramble) {
429 init();
430 String[] s = scramble.split(" ");
431 StringBuilder sb = new StringBuilder();
432 for (int face = 0; face < 6; face++) {
433 int[] co = new int[4], feo = new int[4];
434 for (int i = 0; i < 4; i++) {
435 co[i] = (i + 4) * 3;
436 feo[i] = i * 2;
437 }
438 int ep = 1656, eo = 1104;
439 for (int d = 0; d < s.length; d++)
440 if (s[d].length() != 0) {
441 int m = moveStr[0][face].indexOf(s[d].charAt(0));
442 for (int i = 0; i < 4; i++) {
443 co[i] = fcm[co[i]][m];
444 feo[i] = fem[feo[i]][m];
445 }
446 ep = epm[ep][m]; eo = eom[eo][m];
447 if (s[d].length() > 1) {
448 for (int i = 0; i < 4; i++) {
449 co[i] = fcm[co[i]][m];
450 feo[i] = fem[feo[i]][m];
451 }
452 eo = eom[eo][m]; ep = epm[ep][m];
453 if (s[d].charAt(1) == '\'') {
454 for (int i = 0; i < 4; i++) {
455 co[i] = fcm[co[i]][m];
456 feo[i] = fem[feo[i]][m];
457 }
458 eo = eom[eo][m]; ep = epm[ep][m];
459 }
460 }
461 }
462 solutions = new ArrayList<>();
463 for (int d = 0; d < 11; d++) {
464 for (int slot = 0; slot < 4; slot++) {
465 int[] path = new int[d + 1];
466 idaxcross(ep, eo, co[slot], feo[slot], slot, d, -1, face, path);
467 }
468 if (solutions.size() > 0) {
469 sb.append(color[face]).append(":\n");
470 for (String sol : solutions) {
471 int idx = sol.indexOf('\t');
472 sb.append(" ").append(sol.substring(0, idx)).append("\n");
473 }
474 sb.append("\n");
475 break;
476 }
477 }
478 }
479 return sb.toString();
480 }
481
482 public static String solveEofc(String scramble, int side) {
483 init();

Callers 1

onClickMethod · 0.95

Calls 5

initMethod · 0.95
idaxcrossMethod · 0.95
lengthMethod · 0.80
indexOfMethod · 0.80
toStringMethod · 0.80

Tested by

no test coverage detected