Q:

How do I get a code to generate 4 different random numbers from 1 through 56?

This is a followup to my previous question. Using this code, I'd like to know how to generate 4 different random numbers from 1-56 for the yes case, same from 1-51 for the no case, and a loop back to the start for if neither case is used.
import java.util.Scanner;

public class RandomPerkSelector {

public static void main(String [] args){
Scanner userInputReader = new Scanner(System.in);
System.out.println("Are you playing as a survivor?");
while(true){
String userInput = userInputReader.nextLine();
if(userInput.equals("Yes")){
   //"Yes" case
   //generate your numbers for "Yes"
   break;
}else if(userInput.equals("No")){
   //"No" case
   //generate your numbers for "No"
   break;
}else{
   System.out.println("This is a yes or no question.");
   continue; 
   }
  }
 }
}

A:

Im not sure what your asking but this should make 4 random numbers up to 56.
Random rand = new Random();
int[] nums = new int[4];
for (int i = 0; i < 4; i++) {
    int[i] = rand.nextint(57);
}

