| 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(); |