Project

General

Profile

« Previous | Next » 

Revision 6d637f71

Added by Leszek Koltunski about 1 year ago

Move corner orientation from SolverPyraminx to TablebasesPyraminx (we'll need it for better-looking tablebases scrambling)

View differences:

src/main/java/org/distorted/objectlib/tablebases/TablebasesAbstract.java
377 377

  
378 378
///////////////////////////////////////////////////////////////////////////////////////////////////
379 379

  
380
  public int[][] solution(int index)
380
  int[][] extraInfo(int[][] moves, int[] extra)
381
    {
382
    return moves;
383
    }
384

  
385
///////////////////////////////////////////////////////////////////////////////////////////////////
386

  
387
  public int[][] solution(int index, int[] extra)
381 388
    {
382 389
    if( !mInitialized ) return null;
383 390

  
......
445 452
        }
446 453
      }
447 454

  
448
    return convertMoves(moves);
455
    int[][] ret = convertMoves(moves);
456
    return extraInfo(ret,extra);
449 457
    }
450 458

  
451 459
///////////////////////////////////////////////////////////////////////////////////////////////////
......
458 466
    int scraLen = scramble.length;
459 467
    if( depth>mMinScramble ) depth = mMinScramble;
460 468

  
469
    int[] cornerTwist = new int[4];
470
    for(int i=0; i<4; i++) cornerTwist[i] = (rnd.nextInt(3)-1);
471

  
461 472
    while( solDepth<depth )
462 473
      {
463 474
      int randomPosition = rnd.nextInt(mSize-1);
464
      int[][] sol = solution(randomPosition);
475
      int[][] sol = solution(randomPosition,cornerTwist);
465 476
      solDepth = sol.length;
466 477

  
467 478
      if( solDepth>=depth )

Also available in: Unified diff