Project

General

Profile

Download (16.2 KB) Statistics
| Branch: | Tag: | Revision:

magiccube / src / main / java / org / distorted / objects / RubikCube.java @ ccf9fec5

1 0c52af30 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
2
// Copyright 2019 Leszek Koltunski                                                               //
3
//                                                                                               //
4 fdec60a3 Leszek Koltunski
// This file is part of Magic Cube.                                                              //
5 0c52af30 Leszek Koltunski
//                                                                                               //
6 fdec60a3 Leszek Koltunski
// Magic Cube is free software: you can redistribute it and/or modify                            //
7 0c52af30 Leszek Koltunski
// it under the terms of the GNU General Public License as published by                          //
8
// the Free Software Foundation, either version 2 of the License, or                             //
9
// (at your option) any later version.                                                           //
10
//                                                                                               //
11 fdec60a3 Leszek Koltunski
// Magic Cube is distributed in the hope that it will be useful,                                 //
12 0c52af30 Leszek Koltunski
// but WITHOUT ANY WARRANTY; without even the implied warranty of                                //
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                 //
14
// GNU General Public License for more details.                                                  //
15
//                                                                                               //
16
// You should have received a copy of the GNU General Public License                             //
17 fdec60a3 Leszek Koltunski
// along with Magic Cube.  If not, see <http://www.gnu.org/licenses/>.                           //
18 0c52af30 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
19
20 1f9772f3 Leszek Koltunski
package org.distorted.objects;
21 0c52af30 Leszek Koltunski
22 ccf9fec5 Leszek Koltunski
import android.content.res.Resources;
23 0c52af30 Leszek Koltunski
import android.graphics.Canvas;
24
import android.graphics.Paint;
25
26 14bd7976 Leszek Koltunski
import org.distorted.library.effect.VertexEffectDeform;
27 40ab026e Leszek Koltunski
import org.distorted.library.effect.VertexEffectMove;
28
import org.distorted.library.effect.VertexEffectRotate;
29 f0fa83ae Leszek Koltunski
import org.distorted.library.effect.VertexEffectSink;
30 0c52af30 Leszek Koltunski
import org.distorted.library.main.DistortedEffects;
31
import org.distorted.library.main.DistortedTexture;
32 b32444ee Leszek Koltunski
import org.distorted.library.mesh.MeshBase;
33 411c6285 Leszek Koltunski
import org.distorted.library.mesh.MeshJoined;
34 97c012ae Leszek Koltunski
import org.distorted.library.mesh.MeshRectangles;
35 411c6285 Leszek Koltunski
import org.distorted.library.type.Static1D;
36 0c52af30 Leszek Koltunski
import org.distorted.library.type.Static3D;
37
import org.distorted.library.type.Static4D;
38
39
///////////////////////////////////////////////////////////////////////////////////////////////////
40
41 27a70eae Leszek Koltunski
class RubikCube extends RubikObject
42 0c52af30 Leszek Koltunski
{
43 10585385 Leszek Koltunski
  static final float SQ2 = (float)Math.sqrt(2);
44
45 e844c116 Leszek Koltunski
  // the three rotation axis of a RubikCube. Must be normalized.
46 9cd7695f Leszek Koltunski
  static final Static3D[] AXIS = new Static3D[]
47 efef689c Leszek Koltunski
         {
48
           new Static3D(1,0,0),
49
           new Static3D(0,1,0),
50
           new Static3D(0,0,1)
51
         };
52
53 37a25788 Leszek Koltunski
  private static final int[] FACE_COLORS = new int[]
54 efef689c Leszek Koltunski
         {
55
           0xffffff00, 0xffffffff,   // AXIS[0]right (right-YELLOW) AXIS[0]left (left  -WHITE)
56
           0xff0000ff, 0xff00ff00,   // AXIS[1]right (top  -BLUE  ) AXIS[1]left (bottom-GREEN)
57
           0xffff0000, 0xffb5651d    // AXIS[2]right (front-RED   ) AXIS[2]left (back  -BROWN)
58
         };
59
60 10585385 Leszek Koltunski
  // All legal rotation quats of a RubikCube of any size.
61 efef689c Leszek Koltunski
  // Here's how to compute this:
62
  // 1) compute how many rotations there are (RubikCube of any size = 24)
63
  // 2) take the AXIS, angles of rotation (90 in RubikCube's case) compute the basic quaternions
64
  // (i.e. rotations of 1 basic angle along each of the axis) and from there start semi-randomly
65
  // multiplying them and eventually you'll find all (24) legal rotations.
66 9f4c44fe Leszek Koltunski
  // Example program in C, res/raw/compute_quats.c , is included.
67 10585385 Leszek Koltunski
  private static final Static4D[] QUATS = new Static4D[]
68 efef689c Leszek Koltunski
         {
69 10585385 Leszek Koltunski
         new Static4D(  0.0f,   0.0f,   0.0f,   1.0f),
70
         new Static4D(  1.0f,   0.0f,   0.0f,   0.0f),
71
         new Static4D(  0.0f,   1.0f,   0.0f,   0.0f),
72
         new Static4D(  0.0f,   0.0f,   1.0f,   0.0f),
73
74
         new Static4D( SQ2/2,  SQ2/2,  0.0f ,   0.0f),
75
         new Static4D( SQ2/2, -SQ2/2,  0.0f ,   0.0f),
76
         new Static4D( SQ2/2,   0.0f,  SQ2/2,   0.0f),
77
         new Static4D(-SQ2/2,   0.0f,  SQ2/2,   0.0f),
78
         new Static4D( SQ2/2,   0.0f,   0.0f,  SQ2/2),
79
         new Static4D( SQ2/2,   0.0f,   0.0f, -SQ2/2),
80
         new Static4D(  0.0f,  SQ2/2,  SQ2/2,   0.0f),
81
         new Static4D(  0.0f,  SQ2/2, -SQ2/2,   0.0f),
82
         new Static4D(  0.0f,  SQ2/2,   0.0f,  SQ2/2),
83
         new Static4D(  0.0f,  SQ2/2,   0.0f, -SQ2/2),
84
         new Static4D(  0.0f,   0.0f,  SQ2/2,  SQ2/2),
85
         new Static4D(  0.0f,   0.0f,  SQ2/2, -SQ2/2),
86
87
         new Static4D(  0.5f,   0.5f,   0.5f,   0.5f),
88
         new Static4D(  0.5f,   0.5f,  -0.5f,   0.5f),
89
         new Static4D(  0.5f,   0.5f,  -0.5f,  -0.5f),
90
         new Static4D(  0.5f,  -0.5f,   0.5f,  -0.5f),
91
         new Static4D( -0.5f,  -0.5f,  -0.5f,   0.5f),
92
         new Static4D( -0.5f,   0.5f,  -0.5f,  -0.5f),
93
         new Static4D( -0.5f,   0.5f,   0.5f,  -0.5f),
94
         new Static4D( -0.5f,   0.5f,   0.5f,   0.5f)
95 efef689c Leszek Koltunski
         };
96 411c6285 Leszek Koltunski
97 55fa2499 Leszek Koltunski
  private static MeshBase mMeshBig = null;
98
  private static MeshBase mMeshSma = null;
99 40ab026e Leszek Koltunski
100 411c6285 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
101
102 ccf9fec5 Leszek Koltunski
  RubikCube(int size, Static4D quatCur, Static4D quatAcc, DistortedTexture texture,
103
            MeshRectangles mesh, DistortedEffects effects, int[][] moves, Resources res)
104 411c6285 Leszek Koltunski
    {
105 ccf9fec5 Leszek Koltunski
    super(size, 60, quatCur,quatAcc,texture,mesh,effects,moves, RubikObjectList.CUBE, res);
106 411c6285 Leszek Koltunski
    }
107
108 7289fd6c Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
109
// paint the square with upper-right cornder at (left,top) and side length 'side' with texture
110
// for face 'face'.
111
112
  void createFaceTexture(Canvas canvas, Paint paint, int face, int left, int top, int side)
113
    {
114
    final float R = side*0.10f;
115
    final float M = side*0.05f;
116
117
    paint.setColor(FACE_COLORS[face]);
118
    canvas.drawRoundRect( left+M, top+M, left+side-M, top+side-M, R, R, paint);
119
    }
120
121 411c6285 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
122
123 10a2e360 Leszek Koltunski
  Static3D[] getCubitPositions(int size)
124 a10ada2a Leszek Koltunski
    {
125 10a2e360 Leszek Koltunski
    int numCubits = size>1 ? 6*size*size - 12*size + 8 : 1;
126
    Static3D[] tmp = new Static3D[numCubits];
127 beb325a0 Leszek Koltunski
128 49f67f9b Leszek Koltunski
    float diff = 0.5f*(size-1);
129 a10ada2a Leszek Koltunski
    int currentPosition = 0;
130 beb325a0 Leszek Koltunski
131 a10ada2a Leszek Koltunski
    for(int x = 0; x<size; x++)
132
      for(int y = 0; y<size; y++)
133
        for(int z = 0; z<size; z++)
134
          if( x==0 || x==size-1 || y==0 || y==size-1 || z==0 || z==size-1 )
135 beb325a0 Leszek Koltunski
            {
136 49f67f9b Leszek Koltunski
            tmp[currentPosition++] = new Static3D(x-diff,y-diff,z-diff);
137 a10ada2a Leszek Koltunski
            }
138 47ba5ddc Leszek Koltunski
139 a10ada2a Leszek Koltunski
    return tmp;
140
    }
141 47ba5ddc Leszek Koltunski
142 beb325a0 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
143
144 10585385 Leszek Koltunski
  Static4D[] getQuats()
145 a10ada2a Leszek Koltunski
    {
146 10585385 Leszek Koltunski
    return QUATS;
147 a10ada2a Leszek Koltunski
    }
148 47ba5ddc Leszek Koltunski
149
///////////////////////////////////////////////////////////////////////////////////////////////////
150
151 411c6285 Leszek Koltunski
  int getNumFaces()
152 a10ada2a Leszek Koltunski
    {
153 411c6285 Leszek Koltunski
    return FACE_COLORS.length;
154
    }
155 47ba5ddc Leszek Koltunski
156 f0fa83ae Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
157
158
  float getScreenRatio()
159
    {
160
    return 0.5f;
161
    }
162
163
///////////////////////////////////////////////////////////////////////////////////////////////////
164
165 14bd7976 Leszek Koltunski
  MeshBase createCubitMesh(int cubit)
166 a10ada2a Leszek Koltunski
    {
167 55fa2499 Leszek Koltunski
    return createCubitMesh(getSize()<=3);
168
    }
169
170
///////////////////////////////////////////////////////////////////////////////////////////////////
171
172
  MeshBase createCubitMesh(boolean big)
173
    {
174
    MeshBase mesh = big ? mMeshBig : mMeshSma;
175
    int size = big ? 14 : 9;
176
177
    if( mesh==null )
178 40ab026e Leszek Koltunski
      {
179
      final int MESHES=6;
180
      int association = 1;
181
      MeshBase[] meshes = new MeshRectangles[MESHES];
182 55fa2499 Leszek Koltunski
      meshes[0] = new MeshRectangles(size,size);
183 e82f3f9c Leszek Koltunski
      meshes[0].setEffectAssociation(0,association,0);
184 40ab026e Leszek Koltunski
185
      for(int i=1; i<MESHES; i++)
186
        {
187
        association <<=1;
188
        meshes[i] = meshes[0].copy(true);
189 e82f3f9c Leszek Koltunski
        meshes[i].setEffectAssociation(0,association,0);
190 40ab026e Leszek Koltunski
        }
191
192 55fa2499 Leszek Koltunski
      mesh = new MeshJoined(meshes);
193 40ab026e Leszek Koltunski
194
      Static3D axisY   = new Static3D(0,1,0);
195
      Static3D axisX   = new Static3D(1,0,0);
196
      Static3D center  = new Static3D(0,0,0);
197
      Static1D angle90 = new Static1D(90);
198
      Static1D angle180= new Static1D(180);
199
      Static1D angle270= new Static1D(270);
200
201 14bd7976 Leszek Koltunski
      float d1 = 1.0f;
202
      float d2 =-0.05f;
203
      float d3 = 0.12f;
204
205
      Static3D dCen0 = new Static3D( d1*(+0.5f), d1*(+0.5f), d1*(+0.5f) );
206
      Static3D dCen1 = new Static3D( d1*(+0.5f), d1*(+0.5f), d1*(-0.5f) );
207
      Static3D dCen2 = new Static3D( d1*(+0.5f), d1*(-0.5f), d1*(+0.5f) );
208
      Static3D dCen3 = new Static3D( d1*(+0.5f), d1*(-0.5f), d1*(-0.5f) );
209
      Static3D dCen4 = new Static3D( d1*(-0.5f), d1*(+0.5f), d1*(+0.5f) );
210
      Static3D dCen5 = new Static3D( d1*(-0.5f), d1*(+0.5f), d1*(-0.5f) );
211
      Static3D dCen6 = new Static3D( d1*(-0.5f), d1*(-0.5f), d1*(+0.5f) );
212
      Static3D dCen7 = new Static3D( d1*(-0.5f), d1*(-0.5f), d1*(-0.5f) );
213
214
      Static3D dVec0 = new Static3D( d2*(+0.5f), d2*(+0.5f), d2*(+0.5f) );
215
      Static3D dVec1 = new Static3D( d2*(+0.5f), d2*(+0.5f), d2*(-0.5f) );
216
      Static3D dVec2 = new Static3D( d2*(+0.5f), d2*(-0.5f), d2*(+0.5f) );
217
      Static3D dVec3 = new Static3D( d2*(+0.5f), d2*(-0.5f), d2*(-0.5f) );
218
      Static3D dVec4 = new Static3D( d2*(-0.5f), d2*(+0.5f), d2*(+0.5f) );
219
      Static3D dVec5 = new Static3D( d2*(-0.5f), d2*(+0.5f), d2*(-0.5f) );
220
      Static3D dVec6 = new Static3D( d2*(-0.5f), d2*(-0.5f), d2*(+0.5f) );
221
      Static3D dVec7 = new Static3D( d2*(-0.5f), d2*(-0.5f), d2*(-0.5f) );
222
223
      Static4D dReg  = new Static4D(0,0,0,d3);
224
      Static1D dRad  = new Static1D(1);
225
226 40ab026e Leszek Koltunski
      VertexEffectMove   effect0 = new VertexEffectMove(new Static3D(0,0,+0.5f));
227 e82f3f9c Leszek Koltunski
      effect0.setMeshAssociation(63,-1);  // all 6 sides
228 40ab026e Leszek Koltunski
      VertexEffectRotate effect1 = new VertexEffectRotate( angle180, axisX, center );
229 e82f3f9c Leszek Koltunski
      effect1.setMeshAssociation(32,-1);  // back
230 40ab026e Leszek Koltunski
      VertexEffectRotate effect2 = new VertexEffectRotate( angle90 , axisX, center );
231 e82f3f9c Leszek Koltunski
      effect2.setMeshAssociation( 8,-1);  // bottom
232 40ab026e Leszek Koltunski
      VertexEffectRotate effect3 = new VertexEffectRotate( angle270, axisX, center );
233 e82f3f9c Leszek Koltunski
      effect3.setMeshAssociation( 4,-1);  // top
234 40ab026e Leszek Koltunski
      VertexEffectRotate effect4 = new VertexEffectRotate( angle270, axisY, center );
235 e82f3f9c Leszek Koltunski
      effect4.setMeshAssociation( 2,-1);  // left
236 40ab026e Leszek Koltunski
      VertexEffectRotate effect5 = new VertexEffectRotate( angle90 , axisY, center );
237 e82f3f9c Leszek Koltunski
      effect5.setMeshAssociation( 1,-1);  // right
238 40ab026e Leszek Koltunski
239 14bd7976 Leszek Koltunski
      VertexEffectDeform effect6 = new VertexEffectDeform(dVec0, dRad, dCen0, dReg);
240
      VertexEffectDeform effect7 = new VertexEffectDeform(dVec1, dRad, dCen1, dReg);
241
      VertexEffectDeform effect8 = new VertexEffectDeform(dVec2, dRad, dCen2, dReg);
242
      VertexEffectDeform effect9 = new VertexEffectDeform(dVec3, dRad, dCen3, dReg);
243
      VertexEffectDeform effect10= new VertexEffectDeform(dVec4, dRad, dCen4, dReg);
244
      VertexEffectDeform effect11= new VertexEffectDeform(dVec5, dRad, dCen5, dReg);
245
      VertexEffectDeform effect12= new VertexEffectDeform(dVec6, dRad, dCen6, dReg);
246
      VertexEffectDeform effect13= new VertexEffectDeform(dVec7, dRad, dCen7, dReg);
247
248
      VertexEffectSink   effect14= new VertexEffectSink( new Static1D(1.5f), center, new Static4D(0,0,0,0.72f) );
249
250 55fa2499 Leszek Koltunski
      mesh.apply(effect0);
251
      mesh.apply(effect1);
252
      mesh.apply(effect2);
253
      mesh.apply(effect3);
254
      mesh.apply(effect4);
255
      mesh.apply(effect5);
256
      mesh.apply(effect6);
257
      mesh.apply(effect7);
258
      mesh.apply(effect8);
259
      mesh.apply(effect9);
260
      mesh.apply(effect10);
261
      mesh.apply(effect11);
262
      mesh.apply(effect12);
263
      mesh.apply(effect13);
264
      mesh.apply(effect14);
265
266
      mesh.mergeEffComponents();
267 40ab026e Leszek Koltunski
      }
268 411c6285 Leszek Koltunski
269 55fa2499 Leszek Koltunski
    return mesh.copy(true);
270 a10ada2a Leszek Koltunski
    }
271 e844c116 Leszek Koltunski
272
///////////////////////////////////////////////////////////////////////////////////////////////////
273
// PUBLIC API
274
275 12ad3fca Leszek Koltunski
  public Static3D[] getRotationAxis()
276
    {
277
    return AXIS;
278
    }
279
280
///////////////////////////////////////////////////////////////////////////////////////////////////
281
282 e844c116 Leszek Koltunski
  public int getBasicAngle()
283
    {
284
    return 4;
285
    }
286 39e74052 Leszek Koltunski
287
///////////////////////////////////////////////////////////////////////////////////////////////////
288
289 9621255f Leszek Koltunski
  public float returnMultiplier()
290 39e74052 Leszek Koltunski
    {
291 9621255f Leszek Koltunski
    return getSize();
292 39e74052 Leszek Koltunski
    }
293 e46e17fb Leszek Koltunski
294 5cf34c5f Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
295
296
  public float[] getRowChances()
297
    {
298
    int size = getSize();
299
    float[] chances = new float[size];
300
301
    for(int i=0; i<size; i++)
302
      {
303
      chances[i] = (i+1.0f) / size;
304
      }
305
306
    return chances;
307
    }
308
309 e46e17fb Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
310
311
  public float returnRotationFactor(float offset)
312
    {
313
    return 1.0f;
314
    }
315 f0336037 Leszek Koltunski
316
///////////////////////////////////////////////////////////////////////////////////////////////////
317 a304ee64 Leszek Koltunski
// order: Up --> Right --> Front --> Down --> Left --> Back
318
// (because the first implemented Solver - the two-phase Cube3 one - expects such order)
319
//
320 fa0f7a56 Leszek Koltunski
// Solved 3x3x3 Cube maps to "UUUUUUUUURRRRRRRRRFFFFFFFFFDDDDDDDDDLLLLLLLLLBBBBBBBBB"
321 a304ee64 Leszek Koltunski
//
322 fa0f7a56 Leszek Koltunski
// s : size of the cube; let index = a*s + b    (i.e. a,b = row,column)
323
//
324
// Up    :   index --> b<s-1 ? (s-1)*(s+4b)+a : 6*s*s -13*s +8 +a
325 a304ee64 Leszek Koltunski
// Right :   index --> 6*s*s - 12*s + 7 - index
326 fa0f7a56 Leszek Koltunski
// Front :   index --> if b==0  : s*s - 1 - index
327
//                     if b==s-1: 6*s*s -11*s +6 - index
328
//                     else
329
//                         a==0: s*s + s-1 + 4*(b-1)*(s-1) + 2*(s-2) + s
330
//                         else: s*s + s-1 + 4*(b-1)*(s-1) + 2*(s-1-a)
331
// Down  :   index --> b==0 ? (s-1-a) : s*s + s-1 + 4*(b-1)*(s-1) - a
332
// Left  :   index --> (s-1-a)*s + b
333
// Back  :   index --> if b==s-1: s*(s-1-a)
334
//                     if b==0  : 5*s*s -12*s + 8 + (s-1-a)*s
335
//                     else
336
//                        if a==s-1: s*s + 4*(s-2-b)*(s-1)
337
//                        else     : s*s + 4*(s-2-b)*(s-1) + s + (s-2-a)*2
338 f0336037 Leszek Koltunski
339 20931cf6 Leszek Koltunski
  public String retObjectString()
340 f0336037 Leszek Koltunski
    {
341 fa0f7a56 Leszek Koltunski
    StringBuilder objectString = new StringBuilder();
342
    int size = getSize();
343
    int len = size*size;
344
    int cubitIndex, row, col;
345
    int color;
346
347
    final int RIGHT= 0;
348
    final int LEFT = 1;
349
    final int UP   = 2;
350
    final int DOWN = 3;
351
    final int FRONT= 4;
352
    final int BACK = 5;
353
354
    final char[] FACE_NAMES = { 'R', 'L', 'U', 'D', 'F', 'B'};
355
356
    for(int i=0; i<len; i++)
357
      {
358
      row = i/size;
359
      col = i%size;
360
361
      cubitIndex = col<size-1 ? (size-1)*(size+4*col) + row : 6*size*size - 13*size + 8 + row;
362
      color = getCubitFaceColorIndex(cubitIndex,UP);
363
      objectString.append(FACE_NAMES[color]);
364
      }
365
366
    for(int i=0; i<len; i++)
367
      {
368
      cubitIndex = 6*size*size - 12*size +7 - i;
369
      color = getCubitFaceColorIndex(cubitIndex,RIGHT);
370
      objectString.append(FACE_NAMES[color]);
371
      }
372
373
    for(int i=0; i<len; i++)
374
      {
375
      row = i/size;
376
      col = i%size;
377
378
      if( col==size-1 ) cubitIndex = 6*size*size - 11*size + 6 -i;
379
      else if( col==0 ) cubitIndex = size*size - 1 - i;
380
      else
381
        {
382
        if( row==0 ) cubitIndex = size*size + size-1 + 4*(col-1)*(size-1) + 2*(size-2) + size;
383
        else         cubitIndex = size*size + size-1 + 4*(col-1)*(size-1) + 2*(size-1-row);
384
        }
385
386
      color = getCubitFaceColorIndex(cubitIndex,FRONT);
387
      objectString.append(FACE_NAMES[color]);
388
      }
389
390
    for(int i=0; i<len; i++)
391
      {
392
      row = i/size;
393
      col = i%size;
394
395
      cubitIndex = col==0 ? size-1-row : size*size + size-1 + 4*(col-1)*(size-1) - row;
396
      color = getCubitFaceColorIndex(cubitIndex,DOWN);
397
      objectString.append(FACE_NAMES[color]);
398
      }
399
400
    for(int i=0; i<len; i++)
401
      {
402
      row = i/size;
403
      col = i%size;
404
405
      cubitIndex = (size-1-row)*size + col;
406
      color = getCubitFaceColorIndex(cubitIndex,LEFT);
407
      objectString.append(FACE_NAMES[color]);
408
      }
409
410
    for(int i=0; i<len; i++)
411
      {
412
      row = i/size;
413
      col = i%size;
414
415
      if( col==size-1 ) cubitIndex = size*(size-1-row);
416
      else if( col==0 ) cubitIndex = 5*size*size - 12*size + 8 + (size-1-row)*size;
417
      else
418
        {
419
        if( row==size-1 ) cubitIndex = size*size + 4*(size-2-col)*(size-1);
420
        else              cubitIndex = size*size + 4*(size-2-col)*(size-1) + size + 2*(size-2-row);
421
        }
422
423
      color = getCubitFaceColorIndex(cubitIndex,BACK);
424
      objectString.append(FACE_NAMES[color]);
425
      }
426
427
    return objectString.toString();
428 f0336037 Leszek Koltunski
    }
429 0c52af30 Leszek Koltunski
}