Project

General

Profile

« Previous | Next » 

Revision 92116505

Added by Leszek Koltunski over 1 year ago

Dino6 solver: errors

View differences:

src/main/java/org/distorted/solvers/SolverDino6.java
25 25
  private static final int ERROR_EDGE_CANNOT         = -2;
26 26
  private static final int ERROR_EDGE_TWISTED        = -3;
27 27
  private static final int ERROR_EDGE_MONOCHROMATIC  = -4;
28
  private static final int ERROR_EDGE_TWICE          = -5;
28 29

  
29 30
  int[][] EDGE_MAP = {
30 31
                      {4,2},{0,4},{4,3},{1,4},
......
160 161
    mFaceColors[4] = edges[0][0];
161 162
    mFaceColors[2] = edges[0][1];
162 163
    mFaceColors[5] = computeOpposite(mFaceColors[4], edges, present);
163
    if( mFaceColors[5]<0 ) return ERROR_EDGE_CANNOT;
164
    if( mFaceColors[5]<0 ) return mFaceColors[5];
164 165

  
165 166
    mFaceColors[3] = computeOpposite(mFaceColors[2], edges, present);
166
    if( mFaceColors[3]<0 ) return ERROR_EDGE_CANNOT;
167
    if( mFaceColors[3]<0 ) return mFaceColors[3];
167 168

  
168 169
    int success = fillUpRemainingFaceColors(present);
169 170
    if( success<0 ) return success;
......
199 200

  
200 201
      if( notPresent(m1,m2,edges) )
201 202
        {
202
        android.util.Log.e("D", "edge missing i="+i+" m1="+m1+" m2="+m2);
203

  
204 203
        mErrorColor1 = mFaceColors[m1];
205 204
        mErrorColor2 = mFaceColors[m2];
206 205
        return ERROR_EDGE_MISSING;
......
342 341
    return res.getString(R.string.solver_generic_edge_mono,c0,c1);
343 342
    }
344 343

  
344
///////////////////////////////////////////////////////////////////////////////////////////////////
345

  
346
  private String edgeTwiceError(Resources res, int color0, int color1)
347
    {
348
    int j0 = getColorIndex3(color0);
349
    int j1 = getColorIndex6(color1);
350
    String c0 = res.getString(j0);
351
    String c1 = res.getString(j1);
352

  
353
    return res.getString(R.string.solver_generic_edge_twice,c0,c1);
354
    }
355

  
345 356
///////////////////////////////////////////////////////////////////////////////////////////////////
346 357

  
347 358
  public String error(int index, Resources res)
......
351 362
      case ERROR_EDGE_MISSING      : return edgeMissingError(res,mErrorColor1,mErrorColor2);
352 363
      case ERROR_EDGE_TWISTED      : return edgeTwistedError(res,mErrorColor1,mErrorColor2);
353 364
      case ERROR_EDGE_MONOCHROMATIC: return edgeMonoError(res,mErrorColor1);
365
      case ERROR_EDGE_TWICE        : return edgeTwiceError(res,mErrorColor1,mErrorColor2);
354 366
      case ERROR_EDGE_CANNOT       : return res.getString(R.string.solver_generic_edges_cannot);
355 367
      }
356 368

  
src/main/res/values-de/strings.xml
99 99
    <string name="solver_generic_edges_cannot">Kanten können nicht verdreht werden, sodass alle Seiten einfarbig sind!</string>
100 100
    <string name="solver_generic_c_v_dont_match">Oktaederstücke und Tetraederecken passen nicht zusammen!</string>
101 101
    <string name="solver_generic_edge_mono">%1$s-%2$s Kante?</string>
102
    <string name="solver_generic_edge_twice">Zwei %1$s-%2$s Kanten!</string>
102 103

  
103 104
    <string name="solver_cube3_error1">Es gibt nur %1$d %2$s Facelets.</string>
104 105
    <string name="solver_cube3_error2">Nicht alle 12 Kanten gibt es genau einmal!</string>
src/main/res/values-es/strings.xml
99 99
    <string name="solver_generic_edges_cannot">¡Los bordes no se pueden torcer para que todos los lados sean monocromáticos!</string>
100 100
    <string name="solver_generic_c_v_dont_match">¡Las piezas octaédricas y las esquinas tetraédricas no coinciden!</string>
101 101
    <string name="solver_generic_edge_mono">Borde %1$s-%2$s?</string>
102
    <string name="solver_generic_edge_twice">¡Dos bordes %1$s-%2$s!</string>
102 103

  
103 104
    <string name="solver_cube3_error1">Solo hay %1$d facetas %2$s.</string>
104 105
    <string name="solver_cube3_error2">¡No todos los 12 bordes existen exactamente una vez!</string>
src/main/res/values-fr/strings.xml
99 99
    <string name="solver_generic_edges_cannot">Les bords ne peuvent pas être tordus pour que tous les côtés soient monochromes !</string>
100 100
    <string name="solver_generic_c_v_dont_match">Les pièces octaédriques et les coins tétraédriques ne correspondent pas !</string>
101 101
    <string name="solver_generic_edge_mono">Bord %1$s-%2$s?</string>
102
    <string name="solver_generic_edge_twice">Deux bords %1$s-%2$s !</string>
102 103

  
103 104
    <string name="solver_cube3_error1">Il n\'y a que %1$d facettes %2$s.</string>
104 105
    <string name="solver_cube3_error2">Les 12 arêtes n\'existent pas exactement une fois !</string>
src/main/res/values-ja/strings.xml
99 99
    <string name="solver_generic_edges_cannot">すべての面が単色になるようにエッジをねじることはできません。</string>
100 100
    <string name="solver_generic_c_v_dont_match">八面体のピースと四面体の角が一致しません!</string>
101 101
    <string name="solver_generic_edge_mono">%1$s%2$s エッジ?</string>
102
    <string name="solver_generic_edge_twice">2 つの %1$s-%2$s エッジ!</string>
102 103

  
103 104
    <string name="solver_cube3_error1">%2$s小顔は%1$dつだけ</string>
104 105
    <string name="solver_cube3_error2">12 のエッジすべてが 存在するわけではありません。</string>
src/main/res/values-ko/strings.xml
99 99
    <string name="solver_generic_edges_cannot">모든 면이 단색이 되도록 가장자리를 비틀 수 없습니다!</string>
100 100
    <string name="solver_generic_c_v_dont_match">팔면체 조각과 사면체 모서리가 일치하지 않습니다!</string>
101 101
    <string name="solver_generic_edge_mono">%1$s%2$s 에지?</string>
102
    <string name="solver_generic_edge_twice">두 개의 %1$s-%2$s 모서리!</string>
102 103

  
103 104
    <string name="solver_cube3_error1">%2$s작은 얼굴은  %1$d개뿐입니다.</string>
104 105
    <string name="solver_cube3_error2">12개의 가장자리 모두가 정확하게 한 번 존재하지 않습니다!</string>
src/main/res/values-pl/strings.xml
99 99
    <string name="solver_generic_edges_cannot">Krawędzi nie da się skręcić tak, aby wszystkie boki były monochromatyczne!</string>
100 100
    <string name="solver_generic_c_v_dont_match">Części ośmiościenne i czworościenne rogi nie pasują do siebie!</string>
101 101
    <string name="solver_generic_edge_mono">%1$s-%2$s krawędz?</string>
102
    <string name="solver_generic_edge_twice">Dwie krawędzie %1$s-%2$s!</string>
102 103

  
103 104
    <string name="solver_cube3_error1">Jest tylko %1$d %2$s ścian.</string>
104 105
    <string name="solver_cube3_error2">Któraś z 12 krawędzi nie istnieje!</string>
src/main/res/values-ru/strings.xml
99 99
    <string name="solver_generic_edges_cannot">Ребр нельзя скрутить так, чтобы все стороны были однотонными!</string>
100 100
    <string name="solver_generic_c_v_dont_match">Восьмигранные фигуры и четырехгранные углы не совпадают!</string>
101 101
    <string name="solver_generic_edge_mono">%1$s-%2$s ребрo?</string>
102
    <string name="solver_generic_edge_twice">Два ребра %1$s-%2$s!</string>
102 103

  
103 104
    <string name="solver_cube3_error1">Всего %1$d %2$s граней!</string>
104 105
    <string name="solver_cube3_error2">Не все 12 ребер существуют в единичном экземпляре!</string>
src/main/res/values-zh-rCN/strings.xml
105 105
    <string name="solver_generic_edges_cannot">边缘不能扭曲,所以所有的面都是单色的!</string>
106 106
    <string name="solver_generic_c_v_dont_match">八面体块和四面体角不匹配!</string>
107 107
    <string name="solver_generic_edge_mono">%1$s%2$s 边缘?</string>
108
    <string name="solver_generic_edge_twice">两个 %1$s-%2$s 边!</string>
108 109

  
109 110
    <string name="solver_cube3_error1">只有%1$d个%2$s小面</string>
110 111
    <string name="solver_cube3_error2">并非所有12条边都只存在一次!</string>
src/main/res/values-zh-rTW/strings.xml
99 99
    <string name="solver_generic_edges_cannot">邊緣不能扭曲,所以所有的面都是單色的!</string>
100 100
    <string name="solver_generic_c_v_dont_match">八面體塊和四面體角不匹配!</string>
101 101
    <string name="solver_generic_edge_mono">%1$s%2$s 邊緣?</string>
102
    <string name="solver_generic_edge_twice">兩個 %1$s-%2$s 邊!</string>
102 103

  
103 104
    <string name="solver_cube3_error1">只有%1$d個%2$s小臉</string>
104 105
    <string name="solver_cube3_error2">並非所有12條邊都只存在一次!</string>
src/main/res/values/strings.xml
119 119
    <string name="solver_generic_edges_cannot">Edges cannot be twisted so that all faces are monochromatic!</string>
120 120
    <string name="solver_generic_c_v_dont_match">Octahedral pieces and tetrahedral corners do not match!</string>
121 121
    <string name="solver_generic_edge_mono">%1$s-%2$s edge?</string>
122
    <string name="solver_generic_edge_twice">Two %1$s-%2$s edges!</string>
122 123

  
123 124
    <string name="solver_cube3_error1">There are only %1$d %2$s facelets.</string>
124 125
    <string name="solver_cube3_error2">Not all 12 edges exist exactly once!</string>

Also available in: Unified diff