Revision a2dd09be
Added by Leszek Koltunski almost 2 years ago
src/main/java/org/distorted/solvers/SolverPyraminx.java | ||
---|---|---|
241 | 241 |
{ |
242 | 242 |
int pos = locateEdge(edges,edgeColors[i]); |
243 | 243 |
int twist = edgeTwist(edges[pos],edgeColors[i]); |
244 |
|
|
245 |
//android.util.Log.e("D", "edge "+i+" pos: "+pos+" twist: "+twist); |
|
246 |
|
|
247 | 244 |
quats[i] = TablebasesPyraminx.EDGE_QUATS[pos][twist]; |
248 | 245 |
} |
249 |
/* |
|
250 |
for(int i=0; i<6; i++) |
|
251 |
android.util.Log.e("D", "edge "+i+" : "+quats[i]); |
|
252 |
*/ |
|
246 |
|
|
253 | 247 |
return quats; |
254 | 248 |
} |
255 | 249 |
|
... | ... | |
361 | 355 |
{ |
362 | 356 |
corner_twist[i] = computePieceTwist(i,corners[i],faces1); |
363 | 357 |
|
364 |
android.util.Log.e("D", "corner twist "+i+" : "+corner_twist[i]); |
|
358 |
//android.util.Log.e("D", "corner twist "+i+" : "+corner_twist[i]);
|
|
365 | 359 |
|
366 | 360 |
if( corner_twist[i]<0 ) return ERROR_CORNERS_CANNOT; |
367 | 361 |
} |
... | ... | |
383 | 377 |
if( !even ) return ERROR_TWO_EDGES; |
384 | 378 |
int[] edge_twist = new int[6]; |
385 | 379 |
TablebasesPyraminx.getEdgeTwist(edge_twist,quats,0); |
380 |
/* |
|
381 |
for(int i=0; i<6; i++) |
|
382 |
android.util.Log.e("D", "q edge "+i+" : "+quats[i]); |
|
383 |
|
|
384 |
for(int i=0; i<6; i++) |
|
385 |
android.util.Log.e("D", "p edge "+i+" : "+permutation[i]); |
|
386 |
*/ |
|
387 |
|
|
386 | 388 |
/* |
387 | 389 |
for(int i=0; i<6; i++) |
388 | 390 |
android.util.Log.e("D", "edge twist "+i+" : "+edge_twist[i]); |
... | ... | |
395 | 397 |
int edgeTwist = edge_twist[0]+ 2*(edge_twist[1]+ 2*(edge_twist[2]+ 2*(edge_twist[3]+ 2*edge_twist[4]))); |
396 | 398 |
int perm_num = TablebaseHelpers.computeEvenPermutationNum(permutation); |
397 | 399 |
|
398 |
android.util.Log.e("D", "vertexTwist: : "+vertexTwist+" edgeTwist: "+edgeTwist+" perm_num: "+perm_num ); |
|
400 |
//android.util.Log.e("D", "vertexTwist: : "+vertexTwist+" edgeTwist: "+edgeTwist+" perm_num: "+perm_num );
|
|
399 | 401 |
|
400 | 402 |
return vertexTwist + 81*(edgeTwist + 32*perm_num); |
401 | 403 |
} |
Also available in: Unified diff
Pyraminx solver: progress