Creating a Secret Numbers game, need help with random.
So I am trying to come up with a game that has three levels, easy, medium, and hard as well as a custom. The problem I have is creating a random integer that allows there to be a minimum of 1 and a max of 10 for easy, min of 1 and a max of 25 for medium, and a min of 1 and a max of 100 for hard. The custom difficulty just has a minimum but no max.
This is my method:
public static int randInt(int max)
int min = 1;
java.util.Random rand = new java.util.Random();
return rand.nextInt(max - min) + min;
Any help would be great.
Use if/else if statements to test for what max to use.