Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int[] data = new int[7];
- boolean usable;
- int random;
- for (int i = 0; i < 7; i++) {
- do {
- usable = true;
- random = rand.nextInt(34) + 1;
- for (int j = 0; j <= i; j++) {
- if (data[j] == random) {
- usable = false;
- }
- }
- } while (!usable);
- data[i] = random;
- }
Add Comment
Please, Sign In to add comment