0

I'm trying to create a generator/simulator for a battle royale. The basis is the user inputs a number of entrants to there desire, then label each of those entrants individually, After labeling each entrant they are given a number randomly within a range of the number of entrants inputted previously.

Examples:

Enter number of entrants: 30

Enter entrant #1-30, ect name: John Smith

// User inputs all entrants

// Entrants are randomly assigned new numbers within the range of number of entrants.

New order of entrants displayed in order from 1-30 in a list

Here is the code I have so far:

//Input number of entrants
//User input character name
//Assign character to entrance number at random
//Dice roll
package battle.royale.generator;
import java.util.Scanner;

public class BattleRoyaleGenerator {


public static void main(String[] args) {
    Scanner input = new Scanner(System.in);
    int numberOfentrants;

    System.out.println("How many entrants partake in this battle royale?");
    numberOfentrants = input.nextInt();

    String [] entrantName = new String [numberOfentrants];

    for (int i=0; i<entrantName.length; i++){
    System.out.println("Enter the name of entrant " + (i+1) + " in your rumble. ");
    entrantName[i] = input.next();

}

}
}
  • Possible duplicate of [Random shuffling of an array](http://stackoverflow.com/questions/1519736/random-shuffling-of-an-array) – Meyer Dec 05 '16 at 17:31
  • I'm having some difficulty trying to find a tutorial on sorting an array with user inputs rather than pre-typed variables. – Brian Chin Dec 06 '16 at 21:35

0 Answers0