241 |
241 |
return green_face + 4*(corner_twist[3] + 3*(corner_twist[2] + 3*(corner_twist[1] + 3*corner_twist[0])));
|
242 |
242 |
}
|
243 |
243 |
|
|
244 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
245 |
|
|
246 |
private String cornerError(Resources res, int color0, int color1, int color2)
|
|
247 |
{
|
|
248 |
int j0 = getTetColor(color0,3);
|
|
249 |
int j1 = getTetColor(color1,3);
|
|
250 |
int j2 = getTetColor(color2,4);
|
|
251 |
|
|
252 |
String c0 = res.getString(j0);
|
|
253 |
String c1 = res.getString(j1);
|
|
254 |
String c2 = res.getString(j2);
|
|
255 |
|
|
256 |
return res.getString(R.string.solver_generic_missing_corner,c0,c1,c2);
|
|
257 |
}
|
|
258 |
|
|
259 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
260 |
|
|
261 |
private String centerError(Resources res, int face)
|
|
262 |
{
|
|
263 |
int color = getTetColor(face,2);
|
|
264 |
String clr= res.getString(color);
|
|
265 |
return res.getString(R.string.solver_generic_missing_center,clr);
|
|
266 |
}
|
|
267 |
|
244 |
268 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
245 |
269 |
|
246 |
270 |
public String error(int index, Resources res)
|
247 |
271 |
{
|
248 |
272 |
switch(index)
|
249 |
273 |
{
|
250 |
|
case ERROR_CORNER_YBR_MISSING: String c01 = res.getString(R.string.color_yellow3);
|
251 |
|
String c02 = res.getString(R.string.color_blue3);
|
252 |
|
String c03 = res.getString(R.string.color_red4);
|
253 |
|
return res.getString(R.string.solver_generic_missing_corner,c01,c02,c03);
|
254 |
|
case ERROR_CORNER_GBR_MISSING: String c11 = res.getString(R.string.color_green3);
|
255 |
|
String c12 = res.getString(R.string.color_blue3);
|
256 |
|
String c13 = res.getString(R.string.color_red4);
|
257 |
|
return res.getString(R.string.solver_generic_missing_corner,c11,c12,c13);
|
258 |
|
case ERROR_CORNER_GYR_MISSING: String c21 = res.getString(R.string.color_green3);
|
259 |
|
String c22 = res.getString(R.string.color_yellow3);
|
260 |
|
String c23 = res.getString(R.string.color_red4);
|
261 |
|
return res.getString(R.string.solver_generic_missing_corner,c21,c22,c23);
|
262 |
|
case ERROR_CORNER_GYB_MISSING: String c31 = res.getString(R.string.color_green3);
|
263 |
|
String c32 = res.getString(R.string.color_yellow3);
|
264 |
|
String c33 = res.getString(R.string.color_blue4);
|
265 |
|
return res.getString(R.string.solver_generic_missing_corner,c31,c32,c33);
|
266 |
|
case ERROR_CENTER_G_MISSING : String colorG = res.getString(R.string.color_green2);
|
267 |
|
return res.getString(R.string.solver_generic_missing_center,colorG);
|
268 |
|
case ERROR_CENTER_Y_MISSING : String colorY = res.getString(R.string.color_yellow2);
|
269 |
|
return res.getString(R.string.solver_generic_missing_center,colorY);
|
270 |
|
case ERROR_CENTER_B_MISSING : String colorB = res.getString(R.string.color_blue2);
|
271 |
|
return res.getString(R.string.solver_generic_missing_center,colorB);
|
272 |
|
case ERROR_CENTER_R_MISSING : String colorR = res.getString(R.string.color_red2);
|
273 |
|
return res.getString(R.string.solver_generic_missing_center,colorR);
|
|
274 |
case ERROR_CORNER_YBR_MISSING: return cornerError(res,3,2,1);
|
|
275 |
case ERROR_CORNER_GBR_MISSING: return cornerError(res,3,2,0);
|
|
276 |
case ERROR_CORNER_GYR_MISSING: return cornerError(res,3,1,0);
|
|
277 |
case ERROR_CORNER_GYB_MISSING: return cornerError(res,2,1,0);
|
|
278 |
case ERROR_CENTER_G_MISSING : return centerError(res,0);
|
|
279 |
case ERROR_CENTER_Y_MISSING : return centerError(res,1);
|
|
280 |
case ERROR_CENTER_B_MISSING : return centerError(res,2);
|
|
281 |
case ERROR_CENTER_R_MISSING : return centerError(res,3);
|
274 |
282 |
case ERROR_TWO_CENTERS : return res.getString(R.string.solver_generic_two_centers);
|
275 |
283 |
case ERROR_CORNER_TWISTED : return res.getString(R.string.solver_generic_corner_twist);
|
276 |
284 |
case ERROR_CORNERS_CANNOT : return res.getString(R.string.solver_generic_corners_cannot);
|
minor