1. Evan Gates
  2. cubeutils

Commits

Evan Gates  committed 25e40ec

fix buf when combining moves between phases (was dividing by 6 not 3)
cp and ep values start at 1 due to the permutation index routines I got from Jaap, update to show this

  • Participants
  • Parent commits b85ff9f
  • Branches default

Comments (0)

Files changed (1)

File stand_alone/solve.c

View file
 		if (coord >= choose(i, j - 1)) {
 			coord -= choose(i, j - 1);
 		} else {
-			ep[i] = 8;
+			ep[i] = 9;
 			j--;
 		}
 	}
 	int i, j = 0, coord = 0;
 
 	for (i = 0; i < 12; i++) {
-		if (ep[i] > 7     ) j++;
-		if (ep[i] < 8 && j) coord += choose(i, j - 1);
+		if (ep[i] > 8     ) j++;
+		if (ep[i] < 9 && j) coord += choose(i, j - 1);
 	}
 	return coord;
 }
 	for (i = 0, p = strtok(cube, " \n"); p && i < 12; i++, p = strtok(NULL, " \n")) {
 		for (j = 0; (t = strstr(names[j], p)) == NULL; j++)
 			;
-		ep[i] = j;
+		ep[i] = j + 1;
 		eo[i] = t - names[j];
 	}
 
 	for (i = 0; p && i < 8; i++, p = strtok(NULL, " \n")) {
 		for (j = 0; (t = strstr(names[j + 12], p)) == NULL; j++)
 			;
-		cp[i] = j;
+		cp[i] = j + 1;
 		co[i] = t - names[j + 12];
 	}
 }
 
 		// if the last move from phase 1 and first move from phase 2 are on the same face
 		// it will always be a quarter turn then half turn on FBLR
-		if (sol[11] > -1 && sol[30 - i] > -1 && sol[30 - i] / 6 == sol[11] / 6) {
+		if (sol[11] > -1 && sol[30 - i] > -1 && sol[30 - i] / 3 == sol[11] / 3) {
 			sol[30 - i] = -1;
 			sol[11] += (sol[11] % 3) ? -2 : 2;
 		}