Project

General

Profile

« Previous | Next » 

Revision 46a961fd

Added by Leszek Koltunski about 4 years ago

The 3x3x3 Solver finished - here the last piece of work, locking the centers of the 3x3x3 cube in place so that RubikStateSolver's color picker cannot change them ( the CUBE3 solver assumes this )

View differences:

src/main/java/org/distorted/solvers/SolverMain.java
45 45
    mObjectPosition = position;
46 46
    }
47 47

  
48
///////////////////////////////////////////////////////////////////////////////////////////////////
49
// certain objects have certain cubits locked - for example, the Cube3's centers of
50
// sides always have the same color.
51
// If a certain cubit is locked, return the color (index into it's FACE_COLORS array) it
52
// must have. Otherwise return -1.
53

  
54
  public static int cubitIsLocked(RubikObjectList object, int size, int cubit)
55
    {
56
    if( object == RubikObjectList.CUBE && size == 3)
57
      {
58
      if( cubit==21 ) return 0; // center of the right  face
59
      if( cubit== 4 ) return 1; // center of the left   face
60
      if( cubit==15 ) return 2; // center of the up     face
61
      if( cubit==10 ) return 3; // center of the bottom face
62
      if( cubit==13 ) return 4; // center of the front  face
63
      if( cubit==12 ) return 5; // center of the back   face
64
      }
65

  
66
    return -1;
67
    }
68

  
48 69
///////////////////////////////////////////////////////////////////////////////////////////////////
49 70

  
50 71
  private void solveCube3(RubikStateSolver solver)

Also available in: Unified diff