«
Previous
|
Next
»
Revision c64818f3
Added by Leszek Koltunski 6 days ago
- ID c64818f3a8f6322c20379f804b883e4d2f110146
- Parent ec519d67
| src/main/java/org/distorted/bandaged/BandagedActivity.java | ||
|---|---|---|
| 12 | 12 |
import static android.view.View.LAYOUT_DIRECTION_RTL; |
| 13 | 13 |
|
| 14 | 14 |
import java.io.InputStream; |
| 15 |
import java.util.Random; |
|
| 15 | 16 |
|
| 16 | 17 |
import android.content.Intent; |
| 17 | 18 |
import android.content.SharedPreferences; |
| ... | ... | |
| 274 | 275 |
Intent intent = new Intent(this, PlayActivity.class); |
| 275 | 276 |
intent.putExtra("level", -1);
|
| 276 | 277 |
intent.putExtra("name", name);
|
| 277 |
intent.putExtra("scrambles", NUM_SCRAMBLES);
|
|
| 278 |
|
|
| 279 |
// some small objects (2x2x1 cuboid) might have a tight scramble loop (for example the 2x2x1 |
|
| 280 |
// always comes back to a solved state every 6 moves). So If we always to NUM_SCRAMBLES moves, |
|
| 281 |
// we will always end up in the same position. Thus: vary this a bit. |
|
| 282 |
Random rnd = new Random(); |
|
| 283 |
int seed = rnd.nextInt(6); |
|
| 284 |
intent.putExtra("scrambles", NUM_SCRAMBLES-seed);
|
|
| 285 |
|
|
| 278 | 286 |
intent.putExtra("local", true);
|
| 279 | 287 |
intent.putExtra("ordinal", 0);
|
| 280 | 288 |
startActivity(intent); |
Also available in: Unified diff
fix for wrong scrambling of bandaged cuboids with layers not equal to each other.