Project

General

Profile

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

magiccube / src / main / java / org / distorted / objects / TwistyPyraminx.java @ 48fec01e

1 e844c116 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
2
// Copyright 2019 Leszek Koltunski                                                               //
3
//                                                                                               //
4
// This file is part of Magic Cube.                                                              //
5
//                                                                                               //
6
// Magic Cube is free software: you can redistribute it and/or modify                            //
7
// 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
// Magic Cube is distributed in the hope that it will be useful,                                 //
12
// 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
// along with Magic Cube.  If not, see <http://www.gnu.org/licenses/>.                           //
18
///////////////////////////////////////////////////////////////////////////////////////////////////
19
20 1f9772f3 Leszek Koltunski
package org.distorted.objects;
21 e844c116 Leszek Koltunski
22 ccf9fec5 Leszek Koltunski
import android.content.res.Resources;
23 e844c116 Leszek Koltunski
24 045d8cbd Leszek Koltunski
import org.distorted.helpers.ObjectShape;
25 9c06394a Leszek Koltunski
import org.distorted.helpers.ObjectSticker;
26 bbbfb6af Leszek Koltunski
import org.distorted.helpers.ScrambleState;
27 e844c116 Leszek Koltunski
import org.distorted.library.main.DistortedEffects;
28
import org.distorted.library.main.DistortedTexture;
29 efa8aa48 Leszek Koltunski
import org.distorted.library.mesh.MeshSquare;
30 e844c116 Leszek Koltunski
import org.distorted.library.type.Static3D;
31
import org.distorted.library.type.Static4D;
32 6fd4a72c Leszek Koltunski
import org.distorted.main.R;
33 e844c116 Leszek Koltunski
34 7c969a6d Leszek Koltunski
import java.util.Random;
35
36 e844c116 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
37
38 9c2f0c91 Leszek Koltunski
public class TwistyPyraminx extends TwistyObject
39 e844c116 Leszek Koltunski
{
40 ad38d800 Leszek Koltunski
  static final Static3D[] ROT_AXIS = new Static3D[]
41 e844c116 Leszek Koltunski
         {
42 ac940e24 Leszek Koltunski
           new Static3D(     0,-SQ3/3,-SQ6/3),
43
           new Static3D(     0,-SQ3/3,+SQ6/3),
44
           new Static3D(+SQ6/3,+SQ3/3,     0),
45
           new Static3D(-SQ6/3,+SQ3/3,     0),
46 ad38d800 Leszek Koltunski
         };
47
48 e844c116 Leszek Koltunski
  private static final int[] FACE_COLORS = new int[]
49
         {
50 ece1b58d Leszek Koltunski
           COLOR_GREEN , COLOR_YELLOW,
51
           COLOR_BLUE  , COLOR_RED
52 e844c116 Leszek Koltunski
         };
53
54 bbbfb6af Leszek Koltunski
  private int mCurrState;
55
  private int mIndexExcluded;
56
  private ScrambleState[] mStates;
57
  private int[][] mScrambleTable;
58
  private int[] mNumOccurences;
59 48fec01e Leszek Koltunski
  private int[] mBasicAngle;
60
  private Static4D[] mQuats;
61
  private ObjectSticker[] mStickers;
62 bbbfb6af Leszek Koltunski
63 e844c116 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
64
65 ac940e24 Leszek Koltunski
  TwistyPyraminx(int size, Static4D quat, DistortedTexture texture, MeshSquare mesh,
66
                 DistortedEffects effects, int[][] moves, Resources res, int scrWidth)
67 e844c116 Leszek Koltunski
    {
68 db875721 Leszek Koltunski
    super(size, size, quat, texture, mesh, effects, moves, ObjectList.PYRA, res, scrWidth);
69 bbbfb6af Leszek Koltunski
70
    initializeScrambleStates(size);
71 e844c116 Leszek Koltunski
    }
72
73 48fec01e Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
74
75
  private void initializeQuats()
76
    {
77
    mQuats = new Static4D[]
78
         {
79
         new Static4D(  0.0f,   0.0f,   0.0f,  1.0f),
80
         new Static4D(  0.0f,   1.0f,   0.0f,  0.0f),
81
         new Static4D( SQ2/2,   0.5f,   0.0f,  0.5f),
82
         new Static4D(-SQ2/2,   0.5f,   0.0f,  0.5f),
83
         new Static4D(  0.0f,  -0.5f, -SQ2/2,  0.5f),
84
         new Static4D(  0.0f,  -0.5f,  SQ2/2,  0.5f),
85
         new Static4D( SQ2/2,   0.5f,   0.0f, -0.5f),
86
         new Static4D(-SQ2/2,   0.5f,   0.0f, -0.5f),
87
         new Static4D(  0.0f,  -0.5f, -SQ2/2, -0.5f),
88
         new Static4D(  0.0f,  -0.5f,  SQ2/2, -0.5f),
89
         new Static4D( SQ2/2,   0.0f,  SQ2/2,  0.0f),
90
         new Static4D(-SQ2/2,   0.0f,  SQ2/2,  0.0f)
91
         };
92
    }
93
94 a480ee80 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
95
96 bbbfb6af Leszek Koltunski
  private int[][] generateState(int start, int end)
97 a480ee80 Leszek Koltunski
    {
98 bbbfb6af Leszek Koltunski
    int len = end-start+1;
99
    int[] tmp = new int[6*len];
100
101
    for(int i=0; i<len; i++)
102
      {
103
      tmp[6*i  ] = start;
104
      tmp[6*i+1] = -1;
105
      tmp[6*i+2] = start;
106
      tmp[6*i+3] = start;
107
      tmp[6*i+4] = +1;
108
      tmp[6*i+5] = start;
109
110
      start++;
111
      }
112
113
    return new int[][] {tmp,tmp,tmp,tmp};
114 a480ee80 Leszek Koltunski
    }
115
116 0203be88 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
117
118 bbbfb6af Leszek Koltunski
  private void initializeScrambleStates(int numLayers)
119 0203be88 Leszek Koltunski
    {
120 bbbfb6af Leszek Koltunski
    mStates = new ScrambleState[numLayers];
121 0203be88 Leszek Koltunski
122 bbbfb6af Leszek Koltunski
    for(int i=0; i<numLayers-1; i++)
123 0203be88 Leszek Koltunski
      {
124 bbbfb6af Leszek Koltunski
      mStates[i] = new ScrambleState( generateState(0,numLayers-1-i) );
125 0203be88 Leszek Koltunski
      }
126
127 bbbfb6af Leszek Koltunski
    mStates[numLayers-1] = new ScrambleState( generateState(1,numLayers-2) );
128
    }
129
130
///////////////////////////////////////////////////////////////////////////////////////////////////
131
132
  int[] getSolvedQuats(int cubit, int numLayers)
133
    {
134 48fec01e Leszek Koltunski
    if( mQuats==null ) initializeQuats();
135 bbbfb6af Leszek Koltunski
    int status = retCubitSolvedStatus(cubit,numLayers);
136 48fec01e Leszek Koltunski
    return status<0 ? null : buildSolvedQuats(MovementPyraminx.FACE_AXIS[status],mQuats);
137 0203be88 Leszek Koltunski
    }
138
139 e844c116 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
140
141 e6cf7283 Leszek Koltunski
  private void addTetrahedralLattice(int size, int index, float[][] pos)
142 49f67f9b Leszek Koltunski
    {
143 ac940e24 Leszek Koltunski
    final float DX = 1.0f;
144
    final float DY = SQ2/2;
145
    final float DZ = 1.0f;
146 49f67f9b Leszek Koltunski
147 ac940e24 Leszek Koltunski
    float startX = 0.0f;
148
    float startY =-DY*(size-1)/2;
149
    float startZ = DZ*(size-1)/2;
150 769409d2 Leszek Koltunski
151 ac940e24 Leszek Koltunski
    for(int layer=0; layer<size; layer++)
152 49f67f9b Leszek Koltunski
      {
153 ac940e24 Leszek Koltunski
      float currX = startX;
154
      float currY = startY;
155
156
      for(int x=0; x<layer+1; x++)
157
        {
158
        float currZ = startZ;
159
160
        for(int z=0; z<size-layer; z++)
161
          {
162 e6cf7283 Leszek Koltunski
          pos[index] = new float[] {currX,currY,currZ};
163 ac940e24 Leszek Koltunski
          index++;
164
          currZ -= DZ;
165
          }
166
167
        currX += DX;
168
        }
169
170
      startX-=DX/2;
171
      startY+=DY;
172
      startZ-=DZ/2;
173 49f67f9b Leszek Koltunski
      }
174
    }
175
176
///////////////////////////////////////////////////////////////////////////////////////////////////
177 ac940e24 Leszek Koltunski
// there are (n^3-n)/6 octahedrons and ((n+1)^3 - (n+1))/6 tetrahedrons
178 49f67f9b Leszek Koltunski
179 e6cf7283 Leszek Koltunski
  float[][] getCubitPositions(int size)
180 e844c116 Leszek Koltunski
    {
181 ac940e24 Leszek Koltunski
    int numOcta = (size-1)*size*(size+1)/6;
182
    int numTetra= size*(size+1)*(size+2)/6;
183 e6cf7283 Leszek Koltunski
    float[][] ret = new float[numOcta+numTetra][];
184 49f67f9b Leszek Koltunski
185 ac940e24 Leszek Koltunski
    addTetrahedralLattice(size-1,      0,ret);
186
    addTetrahedralLattice(size  ,numOcta,ret);
187 49f67f9b Leszek Koltunski
188 ac940e24 Leszek Koltunski
    return ret;
189 e844c116 Leszek Koltunski
    }
190
191
///////////////////////////////////////////////////////////////////////////////////////////////////
192
193 10585385 Leszek Koltunski
  Static4D[] getQuats()
194 e844c116 Leszek Koltunski
    {
195 48fec01e Leszek Koltunski
    if( mQuats==null ) initializeQuats();
196
    return mQuats;
197 e844c116 Leszek Koltunski
    }
198
199
///////////////////////////////////////////////////////////////////////////////////////////////////
200
201
  int getNumFaces()
202
    {
203
    return FACE_COLORS.length;
204
    }
205
206 169219a7 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
207
208
  int getSolvedFunctionIndex()
209
    {
210
    return 0;
211
    }
212
213 eab9d8f8 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
214
215 a64e07d0 Leszek Koltunski
  int getNumStickerTypes(int numLayers)
216 eab9d8f8 Leszek Koltunski
    {
217 48fec01e Leszek Koltunski
    return 1;
218 eab9d8f8 Leszek Koltunski
    }
219
220 7403cdfa Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
221
222 e6734aa9 Leszek Koltunski
  float[][] getCuts(int size)
223 7403cdfa Leszek Koltunski
    {
224 e6734aa9 Leszek Koltunski
    float[][] cuts = new float[4][size-1];
225 a97e02b7 Leszek Koltunski
226
    for(int i=0; i<size-1; i++)
227
      {
228 e6734aa9 Leszek Koltunski
      float cut = (1.0f-0.25f*size+i)*(SQ6/3);
229
      cuts[0][i] = cut;
230
      cuts[1][i] = cut;
231
      cuts[2][i] = cut;
232
      cuts[3][i] = cut;
233 a97e02b7 Leszek Koltunski
      }
234
235
    return cuts;
236 7403cdfa Leszek Koltunski
    }
237
238 8f53e513 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
239
240
  int getNumCubitFaces()
241
    {
242 ac940e24 Leszek Koltunski
    return 8;
243 8f53e513 Leszek Koltunski
    }
244
245 f0fa83ae Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
246
247
  float getScreenRatio()
248
    {
249 48fec01e Leszek Koltunski
    return 0.88f;
250 f0fa83ae Leszek Koltunski
    }
251
252 eaee1ddc Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
253
254
  boolean shouldResetTextureMaps()
255
    {
256
    return false;
257
    }
258
259 31cd7256 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
260
261
  private int getNumOctahedrons(int numLayers)
262
    {
263
    return (numLayers-1)*numLayers*(numLayers+1)/6;
264
    }
265
266 f6d06256 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
267
268 ac940e24 Leszek Koltunski
  private int faceColor(int cubit, int axis)
269 f6d06256 Leszek Koltunski
    {
270 f0450fcc Leszek Koltunski
    return CUBITS[cubit].mRotationRow[axis] == 1 ? axis : NUM_FACES;
271 f6d06256 Leszek Koltunski
    }
272
273 f0fa83ae Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
274
275 ac940e24 Leszek Koltunski
  int getFaceColor(int cubit, int cubitface, int size)
276 e844c116 Leszek Koltunski
    {
277 ac940e24 Leszek Koltunski
    if( cubit< (size-1)*size*(size+1)/6 )
278 40ab026e Leszek Koltunski
      {
279 ac940e24 Leszek Koltunski
      switch( cubitface )
280
        {
281
        case 0: return faceColor(cubit,0);
282
        case 2: return faceColor(cubit,1);
283
        case 5: return faceColor(cubit,3);
284
        case 7: return faceColor(cubit,2);
285
        default:return NUM_FACES;
286
        }
287 40ab026e Leszek Koltunski
      }
288 ac940e24 Leszek Koltunski
    else
289 89a11f7b Leszek Koltunski
      {
290 ac940e24 Leszek Koltunski
      return cubitface<NUM_FACES ? faceColor(cubit,cubitface) : NUM_FACES;
291 89a11f7b Leszek Koltunski
      }
292 e844c116 Leszek Koltunski
    }
293
294 045d8cbd Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
295
296
  ObjectShape getObjectShape(int cubit, int numLayers)
297
    {
298
    int variant = getCubitVariant(cubit,numLayers);
299
300
    if( variant==0 )
301
      {
302 48fec01e Leszek Koltunski
      double[][] vertices = new double[][] { { 0.5,0.0,0.5},{ 0.5,0.0,-0.5},{-0.5,0.0,-0.5},{-0.5,0.0,0.5},{ 0.0,SQ2/2,0.0},{ 0.0,-SQ2/2,0.0} };
303
      int[][] vert_indices = new int[][] { {3,0,4},{0,1,4},{1,2,4},{2,3,4},{5,0,3},{5,1,0},{5,2,1},{5,3,2} };
304 045d8cbd Leszek Koltunski
      int N = numLayers==3? 6 : 5;
305
      int E = numLayers==3? 2 : 1;
306
      float[][] bands     = new float[][] { {0.05f,35,0.5f,0.8f,N,E,E} };
307
      int[] bandIndices   = new int[] { 0,0,0,0,0,0,0,0 };
308
      float[][] corners   = new float[][] { {0.04f,0.20f} };
309
      int[] cornerIndices = new int[] { 0,0,0,0,0,0 };
310
      float[][] centers   = new float[][] { {0.0f, 0.0f, 0.0f} };
311
      int[] centerIndices = new int[] { 0,0,0,0,0,0 };
312 48fec01e Leszek Koltunski
      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
313 045d8cbd Leszek Koltunski
      }
314
    else
315
      {
316 48fec01e Leszek Koltunski
      double[][] vertices = new double[][] { {-0.5, SQ2/4, 0.0},{ 0.5, SQ2/4, 0.0},{ 0.0,-SQ2/4, 0.5},{ 0.0,-SQ2/4,-0.5} };
317
      int[][] vert_indices = new int[][] { {2,1,0},{3,0,1},{3,2,0},{2,3,1} };
318 045d8cbd Leszek Koltunski
      int N = numLayers==3? 6 : 5;
319
      int E = numLayers==3? 2 : 1;
320
      float[][] bands     = new float[][] { {0.05f,35,0.5f,0.8f,N,E,E} };
321
      int[] bandIndices   = new int[] { 0,0,0,0 };
322
      float[][] corners   = new float[][] { {0.06f,0.15f} };
323
      int[] cornerIndices = new int[] { 0,0,0,0 };
324
      float[][] centers   = new float[][] { {0.0f, 0.0f, 0.0f} };
325
      int[] centerIndices = new int[] { 0,0,0,0 };
326 48fec01e Leszek Koltunski
      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
327 045d8cbd Leszek Koltunski
      }
328
    }
329
330
///////////////////////////////////////////////////////////////////////////////////////////////////
331
332 3e605536 Leszek Koltunski
  Static4D getQuat(int cubit, int numLayers)
333 045d8cbd Leszek Koltunski
    {
334 48fec01e Leszek Koltunski
    if( mQuats==null ) initializeQuats();
335
    return mQuats[0];
336 045d8cbd Leszek Koltunski
    }
337
338
///////////////////////////////////////////////////////////////////////////////////////////////////
339
340 3e605536 Leszek Koltunski
  int getNumCubitVariants(int numLayers)
341 045d8cbd Leszek Koltunski
    {
342
    return 2;
343
    }
344
345
///////////////////////////////////////////////////////////////////////////////////////////////////
346
347
  int getCubitVariant(int cubit, int numLayers)
348
    {
349
    return cubit<getNumOctahedrons(numLayers) ? 0:1;
350
    }
351
352 7289fd6c Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
353
354 9c06394a Leszek Koltunski
  int getColor(int face)
355 7289fd6c Leszek Koltunski
    {
356 9c06394a Leszek Koltunski
    return FACE_COLORS[face];
357
    }
358
359
///////////////////////////////////////////////////////////////////////////////////////////////////
360 76c2bd07 Leszek Koltunski
361 9c06394a Leszek Koltunski
  ObjectSticker retSticker(int face)
362
    {
363 48fec01e Leszek Koltunski
    if( mStickers==null )
364
      {
365
      float[][] STICKERS = new float[][] { { -0.4330127f, -0.25f, 0.4330127f, -0.25f, 0.0f, 0.5f } };
366
      final float stroke = 0.08f;
367
      final float radius = 0.06f;
368
      final float[] radii= {radius,radius,radius};
369
      mStickers = new ObjectSticker[STICKERS.length];
370
      mStickers[0] = new ObjectSticker(STICKERS[0],null,radii,stroke);
371
      }
372
373 9c06394a Leszek Koltunski
    return mStickers[face/NUM_FACES];
374 7289fd6c Leszek Koltunski
    }
375
376 fb377dae Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
377 7403cdfa Leszek Koltunski
// SQ6/3 = height of the tetrahedron
378 fb377dae Leszek Koltunski
379
  float returnMultiplier()
380
    {
381 d99f3a48 Leszek Koltunski
    return getNumLayers()/(SQ6/3);
382 fb377dae Leszek Koltunski
    }
383
384 7c969a6d Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
385
386 bbbfb6af Leszek Koltunski
  private void initializeScrambling()
387 7c969a6d Leszek Koltunski
    {
388 0203be88 Leszek Koltunski
    int numLayers = getNumLayers();
389
390 bbbfb6af Leszek Koltunski
    if( mScrambleTable ==null )
391 5cf34c5f Leszek Koltunski
      {
392 bbbfb6af Leszek Koltunski
      mScrambleTable = new int[NUM_AXIS][numLayers];
393 7c969a6d Leszek Koltunski
      }
394 bbbfb6af Leszek Koltunski
    if( mNumOccurences ==null )
395 7c969a6d Leszek Koltunski
      {
396 bbbfb6af Leszek Koltunski
      int max=0;
397
398
      for (ScrambleState mState : mStates)
399 3ca97293 Leszek Koltunski
        {
400 bbbfb6af Leszek Koltunski
        int tmp = mState.getTotal(-1);
401
        if (max < tmp) max = tmp;
402 3ca97293 Leszek Koltunski
        }
403 bbbfb6af Leszek Koltunski
404
      mNumOccurences = new int[max];
405 5cf34c5f Leszek Koltunski
      }
406 e46e17fb Leszek Koltunski
407 bbbfb6af Leszek Koltunski
    for(int i=0; i<NUM_AXIS; i++)
408
      for(int j=0; j<numLayers; j++) mScrambleTable[i][j] = 0;
409
    }
410 e46e17fb Leszek Koltunski
411 bbbfb6af Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
412
// PUBLIC API
413 7c969a6d Leszek Koltunski
414 bbbfb6af Leszek Koltunski
  public void randomizeNewScramble(int[][] scramble, Random rnd, int curr, int totalScrambles)
415
    {
416
    if( curr==0 )
417 5043d5d0 Leszek Koltunski
      {
418 bbbfb6af Leszek Koltunski
      mCurrState     = 0;
419
      mIndexExcluded =-1;
420
      initializeScrambling();
421 5043d5d0 Leszek Koltunski
      }
422 bbbfb6af Leszek Koltunski
423
    int[] info= mStates[mCurrState].getRandom(rnd, mIndexExcluded, mScrambleTable, mNumOccurences);
424
425
    scramble[curr][0] = info[0];
426
    scramble[curr][1] = info[1];
427
    scramble[curr][2] = info[2];
428
429
    mCurrState     = info[3];
430
    mIndexExcluded = info[0];
431
    }
432
433
///////////////////////////////////////////////////////////////////////////////////////////////////
434
435
  public Static3D[] getRotationAxis()
436
    {
437
    return ROT_AXIS;
438
    }
439
440
///////////////////////////////////////////////////////////////////////////////////////////////////
441
442
  public int[] getBasicAngle()
443
    {
444 48fec01e Leszek Koltunski
    if( mBasicAngle ==null ) mBasicAngle = new int[] { 3,3,3,3 };
445
    return mBasicAngle;
446 e46e17fb Leszek Koltunski
    }
447 f0336037 Leszek Koltunski
448 6fd4a72c Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
449
450
  public int getObjectName(int numLayers)
451
    {
452
    switch(numLayers)
453
      {
454
      case 3: return R.string.pyra3;
455
      case 4: return R.string.pyra4;
456
      case 5: return R.string.pyra5;
457
      }
458
    return R.string.pyra3;
459
    }
460
461
///////////////////////////////////////////////////////////////////////////////////////////////////
462
463
  public int getInventor(int numLayers)
464
    {
465
    switch(numLayers)
466
      {
467
      case 3: return R.string.pyra3_inventor;
468
      case 4: return R.string.pyra4_inventor;
469
      case 5: return R.string.pyra5_inventor;
470
      }
471
    return R.string.pyra3_inventor;
472
    }
473
474
///////////////////////////////////////////////////////////////////////////////////////////////////
475
476
  public int getComplexity(int numLayers)
477
    {
478
    switch(numLayers)
479
      {
480
      case 3: return 4;
481
      case 4: return 6;
482
      case 5: return 8;
483
      }
484
    return 4;
485
    }
486 e844c116 Leszek Koltunski
}