Revision 55b2d967
Added by Leszek Koltunski over 1 year ago
src/main/java/org/distorted/solvers/SolverPyraminx.java | ||
---|---|---|
15 | 15 |
import org.distorted.objectlib.main.ObjectType; |
16 | 16 |
import org.distorted.objectlib.main.TwistyObject; |
17 | 17 |
import org.distorted.objectlib.tablebases.ImplementedTablebasesList; |
18 |
import org.distorted.objectlib.tablebases.TablebaseHelpers; |
|
18 | 19 |
import org.distorted.objectlib.tablebases.TablebasesAbstract; |
20 |
import org.distorted.objectlib.tablebases.TablebasesPyraminx; |
|
19 | 21 |
|
20 | 22 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
21 | 23 |
|
... | ... | |
43 | 45 |
private static final int ERROR_CORNER_TWISTED = -17; |
44 | 46 |
private static final int ERROR_EDGE_TWISTED = -18; |
45 | 47 |
private static final int ERROR_C_V_DONT_MATCH = -19; |
48 |
private static final int ERROR_TWO_EDGES = -20; |
|
46 | 49 |
|
47 | 50 |
TablebasesAbstract mSolver; |
48 | 51 |
|
... | ... | |
332 | 335 |
} |
333 | 336 |
|
334 | 337 |
int[] quats = computeEdgeQuats(edges); |
335 |
|
|
338 |
int[] permutation = new int[6]; |
|
339 |
TablebasesPyraminx.getEdgePermutation(permutation,quats); |
|
340 |
boolean even = TablebaseHelpers.permutationIsEven(permutation); |
|
341 |
if( !even ) return ERROR_TWO_EDGES; |
|
336 | 342 |
|
337 | 343 |
return 0; |
338 | 344 |
} |
... | ... | |
450 | 456 |
case ERROR_CORNERS_CANNOT : return res.getString(R.string.solver_generic_corners_cannot); |
451 | 457 |
case ERROR_VERTICES_CANNOT : return res.getString(R.string.solver_generic_vertices_cannot); |
452 | 458 |
case ERROR_C_V_DONT_MATCH : return res.getString(R.string.solver_generic_c_v_dont_match); |
453 |
|
|
459 |
case ERROR_TWO_EDGES : return res.getString(R.string.solver_generic_two_edges); |
|
454 | 460 |
} |
455 | 461 |
|
456 | 462 |
return null; |
src/main/res/values-de/strings.xml | ||
---|---|---|
83 | 83 |
<string name="solver_generic_corner_twist">Eine Ecke muss verdreht werden!</string> |
84 | 84 |
<string name="solver_generic_edge_twist">Eine Kante muss verdreht werden!</string> |
85 | 85 |
<string name="solver_generic_two_centers">Zwei Zentren müssen ausgetauscht werden!</string> |
86 |
<string name="solver_generic_two_edges">Zwei Randstücke müssen ausgetauscht werden!</string> |
|
86 | 87 |
<string name="solver_generic_missing_center">Die %1$s Mitte fehlt!</string> |
87 | 88 |
<string name="solver_generic_missing_corner">Die %1$s-%2$s-%3$s Ecke fehlt!</string> |
88 | 89 |
<string name="solver_generic_missing_vertex">Der %1$s-%2$s-%3$s Oktaeder fehlt!</string> |
src/main/res/values-es/strings.xml | ||
---|---|---|
83 | 83 |
<string name="solver_generic_corner_twist">¡Hay que torcer una esquina!</string> |
84 | 84 |
<string name="solver_generic_edge_twist">¡Hay que torcer una borde!</string> |
85 | 85 |
<string name="solver_generic_two_centers">¡Hay que cambiar dos centros!</string> |
86 |
<string name="solver_generic_two_edges">¡Hay que cambiar dos piezas de borde!</string> |
|
86 | 87 |
<string name="solver_generic_missing_center">¡Falta el centro %1$s!</string> |
87 | 88 |
<string name="solver_generic_missing_corner">¡Falta la esquina %1$s-%2$s-%3$s!</string> |
88 | 89 |
<string name="solver_generic_missing_vertex">¡Falta el octaedro %1$s-%2$s-%3$s!</string> |
src/main/res/values-fr/strings.xml | ||
---|---|---|
83 | 83 |
<string name="solver_generic_corner_twist">Un coin doit être tourné !</string> |
84 | 84 |
<string name="solver_generic_edge_twist">Un bord doit être tourné !</string> |
85 | 85 |
<string name="solver_generic_two_centers">Deux centres doivent être échangés !</string> |
86 |
<string name="solver_generic_two_edges">Deux pièces de bord doivent être échangées !</string> |
|
86 | 87 |
<string name="solver_generic_missing_center">Centre %1$s manquant !</string> |
87 | 88 |
<string name="solver_generic_missing_corner">Coin %1$s-%2$s-%3$s manquant !</string> |
88 | 89 |
<string name="solver_generic_missing_vertex">L\'octaèdre %1$s-%2$s-%3$s manque !</string> |
src/main/res/values-ja/strings.xml | ||
---|---|---|
84 | 84 |
<string name="solver_generic_corner_twist">1 つのコーナーをねじる必要があります。</string> |
85 | 85 |
<string name="solver_generic_edge_twist">片方の端をひねる必要がある!</string> |
86 | 86 |
<string name="solver_generic_two_centers">2つのセンターを交換しなければならない!</string> |
87 |
<string name="solver_generic_two_edges">2 つのエッジ ピースを交換する必要があります。</string> |
|
87 | 88 |
<string name="solver_generic_missing_center">%1$sのセンターが欠けてる!</string> |
88 | 89 |
<string name="solver_generic_missing_corner">%1$s%2$s%3$sのコーナーがない!</string> |
89 | 90 |
<string name="solver_generic_missing_vertex">%1$s-%2$s-%3$s八面体がありません!</string> |
src/main/res/values-ko/strings.xml | ||
---|---|---|
83 | 83 |
<string name="solver_generic_corner_twist">한쪽 모서리를 비틀어야 합니다!</string> |
84 | 84 |
<string name="solver_generic_edge_twist">한쪽 가장자리를 비틀어야 합니다!</string> |
85 | 85 |
<string name="solver_generic_two_centers">두 개의 센터를 교환해야 합니다!</string> |
86 |
<string name="solver_generic_two_edges">두 모서리 조각을 교환해야 합니다!</string> |
|
86 | 87 |
<string name="solver_generic_missing_center">%1$s 중앙이 사라졌습니다!</string> |
87 | 88 |
<string name="solver_generic_missing_corner">%1$s-%2$s-%3$s 모서리 금지!</string> |
88 | 89 |
<string name="solver_generic_missing_vertex">%1$s-%2$s-%3$s 팔면체가 없습니다!</string> |
src/main/res/values-pl/strings.xml | ||
---|---|---|
83 | 83 |
<string name="solver_generic_corner_twist">Jeden z rogów musi byc obrócony!</string> |
84 | 84 |
<string name="solver_generic_edge_twist">Jedna z krawędzi musi byc obrócona!</string> |
85 | 85 |
<string name="solver_generic_two_centers">Dwa środki muszą być wymienione!</string> |
86 |
<string name="solver_generic_two_edges">Dwie krawędzie muszą być wymienione!</string> |
|
86 | 87 |
<string name="solver_generic_missing_center">Brakuje %1$s środka!</string> |
87 | 88 |
<string name="solver_generic_missing_corner">Brakuje %1$s-%2$s-%3$s rogu!</string> |
88 | 89 |
<string name="solver_generic_missing_vertex">Brakuje %1$s-%2$s-%3$s ośmiokątu!</string> |
src/main/res/values-ru/strings.xml | ||
---|---|---|
81 | 81 |
|
82 | 82 |
<string name="solver_generic_not_implemented">Решебника для этого объекта и размера еще нет!</string> |
83 | 83 |
<string name="solver_generic_corner_twist">Один угол должен быть переставлен!</string> |
84 |
<string name="solver_generic_edge_twist">Один край должен быть переставлен!</string>
|
|
84 |
<string name="solver_generic_edge_twist">Одно ребро должно быть переставлен!</string>
|
|
85 | 85 |
<string name="solver_generic_two_centers">Два центра должны быть обменены!</string> |
86 |
<string name="solver_generic_two_edges">Два ребра должны быть заменены!</string> |
|
86 | 87 |
<string name="solver_generic_missing_center">Нет %1$s центра!</string> |
87 | 88 |
<string name="solver_generic_missing_corner">Нет %1$s-%2$s-%3$s угла!</string> |
88 | 89 |
<string name="solver_generic_missing_vertex">Нет %1$s-%2$s-%3$s октаэдра!</string> |
89 |
<string name="solver_generic_missing_edge">Нет %1$s-%2$s края!</string>
|
|
90 |
<string name="solver_generic_missing_edge">Нет %1$s-%2$s ребра!</string>
|
|
90 | 91 |
<string name="solver_generic_corners_cannot">Углы нельзя скручивать так, чтобы все стороны были однотонными!</string> |
91 | 92 |
<string name="solver_generic_vertices_cannot">Восьмигранные фигуры нельзя скрутить так, чтобы все стороны были однотонными!</string> |
92 | 93 |
<string name="solver_generic_c_v_dont_match">Восьмигранные фигуры и четырехгранные углы не совпадают!</string> |
src/main/res/values-zh-rCN/strings.xml | ||
---|---|---|
89 | 89 |
<string name="solver_generic_corner_twist">一个角需要扭动!</string> |
90 | 90 |
<string name="solver_generic_edge_twist">一条边需要扭动!</string> |
91 | 91 |
<string name="solver_generic_two_centers">必须要交换两个中心!</string> |
92 |
<string name="solver_generic_two_edges"></string> |
|
92 | 93 |
<string name="solver_generic_missing_center">%1$s中心不見了!</string> |
93 | 94 |
<string name="solver_generic_missing_corner">没有%1$s-%2$s-%3$s的角落!</string> |
94 | 95 |
<string name="solver_generic_missing_vertex">没有%1$s-%2$s-%3$s八面体!</string> |
src/main/res/values-zh-rTW/strings.xml | ||
---|---|---|
83 | 83 |
<string name="solver_generic_corner_twist">一個角需要扭動!</string> |
84 | 84 |
<string name="solver_generic_edge_twist">一個邊緣要扭動!</string> |
85 | 85 |
<string name="solver_generic_two_centers">兩個中鋒要互換!</string> |
86 |
<string name="solver_generic_two_edges"></string> |
|
86 | 87 |
<string name="solver_generic_missing_center">%1$s的中心不见了!</string> |
87 | 88 |
<string name="solver_generic_missing_corner">沒有%1$s-%2$s-%3$s的角落!</string> |
88 | 89 |
<string name="solver_generic_missing_vertex">沒有%1$s-%2$s-%3$s八面體!</string> |
src/main/res/values/strings.xml | ||
---|---|---|
103 | 103 |
<string name="solver_generic_corner_twist">One corner has to be twisted!</string> |
104 | 104 |
<string name="solver_generic_edge_twist">One edge has to be twisted!</string> |
105 | 105 |
<string name="solver_generic_two_centers">Two centers have to be exchanged!</string> |
106 |
<string name="solver_generic_two_edges">Two edges have to be exchanged!</string> |
|
106 | 107 |
<string name="solver_generic_missing_center">The %1$s center is missing!</string> |
107 | 108 |
<string name="solver_generic_missing_corner">The %1$s-%2$s-%3$s corner is missing!</string> |
108 | 109 |
<string name="solver_generic_missing_vertex">The %1$s-%2$s-%3$s octahedron piece is missing!</string> |
Also available in: Unified diff
Pyraminx solver: progress