android - Calling random value from an array list -
i new android programming on eclipse , have problem trying figure out on how call random values list in array. codes follows:
final float column_positions[][] = new float[][] { { 600, 0.5f }, { 900, 0.3f }, { 1200, 0.2f } };
final random rnd = new random(); // random column final float[] randomcolumn = column_positions[rnd.nextint(column_positions.length)]; //get random row random column float random = randomcolumn[rnd.nextint(randomcolumn.length)];
Comments
Post a Comment