I've made a random wrestling match generator that I've adapted from a random phrase generator from a textbook. I'd like to know how to make it so the same name isn't done twice on the same run. Can't have The Crusher vs. The Crusher, right?
public class matchOMatic {
public static void main (String [] args) {
String [] wordListOne = {"The Crusher", "The Main Man", "The Macho-man, Randy Savage", "The Nature Boy, Rick Flare", "Batista", "Hollywood Hulk Hogan", "Vader", "The Undertaker", "Stone Cold Steve Austin" };
String [] wordListThree = {"The Crusher", "The Main Man", "The Macho-man, Randy Savage", "The Nature Boy, Rick Flare", "Batista", "Hollywood Hulk Hogan", "Vader", "The Undertaker", "Stone Cold Steve Austin"};
int oneLength = wordListOne.length;
int threeLength = wordListThree.length;
int rand1 = (int) (Math.random() * oneLength);
int rand3 = (int) (Math.random() * threeLength);
String phrase = wordListOne[rand1] + " and in the opposite corner is his opponent, " + wordListThree[rand3];
System.out.print("In this corner we have " + phrase);
System.out.println("!");
}
}