Skip to content

Instantly share code, notes, and snippets.

@marlonlom
Created November 27, 2014 20:43
Show Gist options
  • Save marlonlom/167ce0a3762e19574bec to your computer and use it in GitHub Desktop.
Save marlonlom/167ce0a3762e19574bec to your computer and use it in GitHub Desktop.
import java.util.ArrayList;
import java.util.Collections;
import java.util.Random;
public class BalotoDummyDemo {
public static void main(String[] args) {
Random rand = new Random();
int max = 45;
int min = 1;
ArrayList<Integer> listNums = new ArrayList<Integer>(6);
do {
int randomNum = rand.nextInt((max - min) + 1) + min;
if (!listNums.contains(randomNum)) {
listNums.add(randomNum);
}
} while (listNums.size() < 6);
Collections.sort(listNums);
System.out.println("nums: " + listNums.toString());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment