Project

General

Profile

« Previous | Next » 

Revision 5cf34c5f

Added by Leszek Koltunski about 4 years ago

Make chances to randimoze a given row when scrambling dependant on the type of Object.

The point: in case of the Cube, all rows should have equal chances. In case of the Pyraminx, the smaller the row, the smaller the chance should be. In particular the trivial 4 corners of the tetraherdon should have a very small chance to be selected.

View differences:

src/main/java/org/distorted/objects/RubikCube.java
219 219
    return getSize();
220 220
    }
221 221

  
222
///////////////////////////////////////////////////////////////////////////////////////////////////
223

  
224
  public float[] getRowChances()
225
    {
226
    int size = getSize();
227
    float[] chances = new float[size];
228

  
229
    for(int i=0; i<size; i++)
230
      {
231
      chances[i] = (i+1.0f) / size;
232
      }
233

  
234
    return chances;
235
    }
236

  
222 237
///////////////////////////////////////////////////////////////////////////////////////////////////
223 238

  
224 239
  public float returnRotationFactor(float offset)
......
337 352
      objectString.append(FACE_NAMES[color]);
338 353
      }
339 354

  
340
    // android.util.Log.e("cube", "string: "+objectString.toString());
341

  
342 355
    return objectString.toString();
343 356
    }
344 357
}

Also available in: Unified diff