Guest User

Untitled

a guest
Apr 20th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. int[] data = new int[7];
  2. boolean usable;
  3. int random;
  4. for (int i = 0; i < 7; i++) {
  5. do {
  6. usable = true;
  7. random = rand.nextInt(34) + 1;
  8. for (int j = 0; j <= i; j++) {
  9. if (data[j] == random) {
  10. usable = false;
  11. }
  12. }
  13. } while (!usable);
  14. data[i] = random;
  15. }
Add Comment
Please, Sign In to add comment