Project

General

Profile

« Previous | Next » 

Revision e42a9e87

Added by Leszek Koltunski over 2 years ago

Fix the Square-2 isSolved() (it was wrong even before!)

View differences:

src/main/java/org/distorted/objects/TwistySquare2.java
182 182
    }
183 183

  
184 184
///////////////////////////////////////////////////////////////////////////////////////////////////
185
// Square-2 is solved iff
186
// a) all of its cubits are rotated with the same quat
187
// b) its two 'middle' cubits are rotated with the same quat, the 6 'front' and 6 'back'
188
// edges and corners with this quat multiplied by QUATS[18] (i.e. those are upside down)
189
// and all the 12 left and right edges and corners also with the same quat multiplied by
190
// QUATS[12] - i.e. also upside down.
191

  
192
  private static final int[] S18 = new int[] {18};
193
  private static final int[] S12 = new int[] {12};
194 185

  
195 186
  int[] getSolvedQuats(int cubit, int numLayers)
196 187
    {
197
    switch(cubit)
198
      {
199
      case  0: case  1: return null;
200
      case  2: case  4: case  6: case  8:
201
      case 10: case 12: case 14: case 16:
202
      case 19: case 21: case 23: case 25: return S18;
203
      case  3: case  5: case  7: case  9:
204
      case 11: case 13: case 15: case 17:
205
      case 18: case 20: case 22: case 24: return S12;
206
      }
207

  
208 188
    return null;
209 189
    }
210 190

  
......
281 261
    return CENTERS;
282 262
    }
283 263

  
264
///////////////////////////////////////////////////////////////////////////////////////////////////
265

  
266
  int getSolvedFunctionIndex()
267
    {
268
    return 3;
269
    }
270

  
284 271
///////////////////////////////////////////////////////////////////////////////////////////////////
285 272

  
286 273
  int getNumStickerTypes(int numLayers)

Also available in: Unified diff