Project

General

Profile

« Previous | Next » 

Revision 030f1bf4

Added by Leszek Koltunski almost 2 years ago

Progress with Skewb Diamond solver.

View differences:

src/main/java/org/distorted/solvers/SolverSkewbDiamond.java
276 276

  
277 277
  private void getCorners(TwistyObject object, int[][] corners)
278 278
    {
279
    corners[0][0] = object.getCubitFaceStickerIndex( 0,0); // FR
280
    corners[0][1] = object.getCubitFaceStickerIndex( 0,1);
281
    corners[0][2] = object.getCubitFaceStickerIndex( 0,5);
282
    corners[0][3] = object.getCubitFaceStickerIndex( 0,4);
283

  
284
    corners[1][0] = object.getCubitFaceStickerIndex( 1,1); // BR
285
    corners[1][1] = object.getCubitFaceStickerIndex( 1,2);
286
    corners[1][2] = object.getCubitFaceStickerIndex( 1,6);
287
    corners[1][3] = object.getCubitFaceStickerIndex( 1,5);
288

  
289
    corners[2][0] = object.getCubitFaceStickerIndex( 2,2); // BL
290
    corners[2][1] = object.getCubitFaceStickerIndex( 2,3);
291
    corners[2][2] = object.getCubitFaceStickerIndex( 2,7);
292
    corners[2][3] = object.getCubitFaceStickerIndex( 2,6);
293

  
294
    corners[3][0] = object.getCubitFaceStickerIndex( 3,3); // FL
295
    corners[3][1] = object.getCubitFaceStickerIndex( 3,0);
296
    corners[3][2] = object.getCubitFaceStickerIndex( 3,4);
297
    corners[3][3] = object.getCubitFaceStickerIndex( 3,7);
279
    corners[0][0] = object.getCubitFaceStickerIndex( 0,5); // FR
280
    corners[0][1] = object.getCubitFaceStickerIndex( 0,4);
281
    corners[0][2] = object.getCubitFaceStickerIndex( 0,0);
282
    corners[0][3] = object.getCubitFaceStickerIndex( 0,1);
283

  
284
    corners[1][0] = object.getCubitFaceStickerIndex( 1,2); // BR
285
    corners[1][1] = object.getCubitFaceStickerIndex( 1,6);
286
    corners[1][2] = object.getCubitFaceStickerIndex( 1,5);
287
    corners[1][3] = object.getCubitFaceStickerIndex( 1,1);
288

  
289
    corners[2][0] = object.getCubitFaceStickerIndex( 2,7); // BL
290
    corners[2][1] = object.getCubitFaceStickerIndex( 2,6);
291
    corners[2][2] = object.getCubitFaceStickerIndex( 2,2);
292
    corners[2][3] = object.getCubitFaceStickerIndex( 2,3);
293

  
294
    corners[3][0] = object.getCubitFaceStickerIndex( 3,0); // FL
295
    corners[3][1] = object.getCubitFaceStickerIndex( 3,4);
296
    corners[3][2] = object.getCubitFaceStickerIndex( 3,7);
297
    corners[3][3] = object.getCubitFaceStickerIndex( 3,3);
298 298

  
299 299
    corners[4][0] = object.getCubitFaceStickerIndex( 4,0); // U
300 300
    corners[4][1] = object.getCubitFaceStickerIndex( 4,3);
301 301
    corners[4][2] = object.getCubitFaceStickerIndex( 4,2);
302 302
    corners[4][3] = object.getCubitFaceStickerIndex( 4,1);
303 303

  
304
    corners[5][0] = object.getCubitFaceStickerIndex( 5,6); // D
305
    corners[5][1] = object.getCubitFaceStickerIndex( 5,7);
306
    corners[5][2] = object.getCubitFaceStickerIndex( 5,4);
307
    corners[5][3] = object.getCubitFaceStickerIndex( 5,5);
304
    corners[5][0] = object.getCubitFaceStickerIndex( 5,5); // D
305
    corners[5][1] = object.getCubitFaceStickerIndex( 5,6);
306
    corners[5][2] = object.getCubitFaceStickerIndex( 5,7);
307
    corners[5][3] = object.getCubitFaceStickerIndex( 5,4);
308 308
    }
309 309

  
310 310
///////////////////////////////////////////////////////////////////////////////////////////////////
......
331 331
    getCorners(object,corners);
332 332
    getCenters(object,centers);
333 333

  
334
for(int j=0; j<8; j++)
335
  {
336
  android.util.Log.e("D", "center "+j+" : "+centers[j]);
337
  }
338

  
334 339
    int result1 = checkAllCentersPresent(centers);
335 340
    if( result1<0 ) return result1;
336 341

  
......
349 354
    if( !even2 ) return ERROR_TWO_CENTERS;
350 355

  
351 356
    int[] corners_twist = getCornersTwist(corners_perm, corners);
357

  
358
android.util.Log.e("D", "faces: "+mFaceColors[0]+" "+mFaceColors[1]+" "+mFaceColors[2]+" "
359
+mFaceColors[3]+" "+mFaceColors[4]+" "+mFaceColors[5]+" "+mFaceColors[6]+" "+mFaceColors[7]);
360

  
361
android.util.Log.e("D", "corn perm: "+corners_perm[0]+" "+corners_perm[1]+" "+corners_perm[2]+" "
362
+corners_perm[3]+" "+corners_perm[4]+" "+corners_perm[5]);
363

  
364
android.util.Log.e("D", "corn twist: "+corners_twist[0]+" "+corners_twist[1]+" "+corners_twist[2]+" "
365
+corners_twist[3]+" "+corners_twist[4]+" "+corners_twist[5]);
366

  
352 367
    int totalTwist = getTotalTwist(corners_twist);
353 368
    if( totalTwist<0 ) return ERROR_CORNER_TWIST;
354 369

  
......
400 415

  
401 416
  private int getColorIndex2(int face)
402 417
    {
403
    switch(mFaceColors[face])
418
    switch(face)
404 419
      {
405 420
      case 0: return R.string.color_violet2;
406 421
      case 1: return R.string.color_grey2;
......
470 485
    if( mSolver==null )
471 486
      {
472 487
      mSolver = ImplementedTablebasesList.createUnpacked(ObjectType.DIAM_2);
473
      if( mSolver!=null ) mSolver.createTablebase();
488
     // if( mSolver!=null ) mSolver.createTablebase();
474 489
      }
475 490

  
476 491
    return mSolver!=null ? mSolver.solution(index) : null;

Also available in: Unified diff