Project

General

Profile

« Previous | Next » 

Revision b7ada775

Added by Leszek Koltunski about 1 year ago

More translations for the CU_232 solver

View differences:

src/main/java/org/distorted/solvers/SolverCuboid232.java
203 203
    return 0;
204 204
    }
205 205

  
206
///////////////////////////////////////////////////////////////////////////////////////////////////
207

  
208
  private int[] correctEdgePerm(int[] perm)
209
    {
210
    int[] ret = new int[3];
211

  
212
    ret[0] = perm[0];
213
    ret[1] = perm[2];
214
    ret[3] = perm[3];
215

  
216
    if( ret[0]>1 ) ret[0]--;
217
    if( ret[1]>1 ) ret[1]--;
218
    if( ret[2]>1 ) ret[2]--;
219

  
220
    return ret;
221
    }
222

  
206 223
///////////////////////////////////////////////////////////////////////////////////////////////////
207 224

  
208 225
  public SolverCuboid232(Resources res, TwistyObject object)
......
270 287
    int result2 = retEdgePermutation(edge_perm,edges);
271 288
    if( result2<0 ) return result2;
272 289

  
273
    int corner_perm_num = TablebaseHelpers.computePermutationNum(corner_perm);
274
    int edge_perm_num = TablebaseHelpers.computePermutationNum(edge_perm);
290
    int[] edge_perm2 = correctEdgePerm(edge_perm); // edge1 is fixed!
275 291

  
276
    // TODO: adjust edge_perm_num to account for the fact that edge[1] is fixed
292
    int corner_perm_num = TablebaseHelpers.computePermutationNum(corner_perm);
293
    int edge_perm_num = TablebaseHelpers.computePermutationNum(edge_perm2);
277 294

  
278 295
    return edge_perm_num + 6*corner_perm_num;
279 296
    }

Also available in: Unified diff