Commits

Anonymous committed a580cf0 Merge

merge

Comments (0)

Files changed (2)

 int  co_trans[2187][6], eo_trans[2048][6], cp_trans[40320][6], ep_trans[40320][6], ud1_trans[495][6], ud2_trans[24][6];
 int  co_coord,          eo_coord,          cp_coord,           ep_coord,           ud1_coord,         ud2_coord;
 
+/*
+ * moves are:
+ * U U2 U' D D2 D' F F2 F' B B2 B' R  R2 R' L  L2 L'
+ * 0 1  2  3 4  5  6 7  8  9 10 11 12 13 14 15 16 17
+ */
 int phase_1_moves[12], phase_2_moves[18]; // yuck, need a single array for all moves
 
 char c_cycles[6][4] = {
 
 	for (i = 0; phase_2(ep_coord, cp_coord, ud2_coord, i, 18) == 0; i++) {}
 
+	i--;
+	if (Math.floor(phase_1_moves[0] / 6) == Math.floor(phase_2_moves[i] / 6)) {
+		phase_1_moves[0] = phase_1_moves[0] - (phase_1_moves[0] % 3) + ((phase_1_moves[0] % 3) ? 0 : 2);
+		phase_2_moves[i] = undefined;
+	}
+
 	if (invert) {
 		for (i = 0; i < 18; i++)
 			if (phase_2_moves[i] != undefined)