Server/Server/src/main/java/uulm/teamname/marvelous/server/lobbymanager/RandomWordGenerator.java

140 lines
3.3 KiB
Java

package uulm.teamname.marvelous.server.lobbymanager;
import java.util.Random;
public class RandomWordGenerator {
private static Random random = new Random();
public static String generateTwoWords() {
var firstWord = randomWords[random.nextInt(randomWords.length)];
var secondWord = randomWords[random.nextInt(randomWords.length)];
while (firstWord.equals(secondWord)) {
secondWord = randomWords[random.nextInt(randomWords.length)];
}
firstWord = firstWord.substring(0, 1).toUpperCase() + firstWord.substring(1).toLowerCase();
secondWord = secondWord.substring(0, 1).toUpperCase() + secondWord.substring(1).toLowerCase();
return firstWord + secondWord;
}
private static final String[] randomWords = new String[]{
"wait",
"release",
"river",
"important",
"mark",
"electric",
"defective",
"poke",
"blue",
"beef",
"spring",
"hurt",
"orange",
"happy",
"zealous",
"flowery",
"accurate",
"brake",
"title",
"x-ray",
"festive",
"wrathful",
"scissors",
"peaceful",
"finicky",
"shape",
"soothe",
"head",
"spotted",
"needless",
"time",
"abundant",
"humdrum",
"mouth",
"trot",
"bounce",
"thank",
"avoid",
"shocking",
"minor",
"secret",
"rabbit",
"protect",
"honey",
"business",
"worthless",
"suggest",
"splendid",
"drab",
"safe",
"gigantic",
"arrive",
"drum",
"hate",
"dinosaurs",
"bore",
"tired",
"regret",
"fit",
"potato",
"confuse",
"childlike",
"vein",
"sound",
"attack",
"exchange",
"back",
"check",
"damaged",
"grandmother",
"division",
"groovy",
"throat",
"office",
"pin",
"stare",
"meddle",
"shivering",
"interfere",
"occur",
"hole",
"sugar",
"test",
"blind",
"free",
"perform",
"cherries",
"flavor",
"stupendous",
"purpose",
"extend",
"risk",
"fanatical",
"grubby",
"beg",
"romantic",
"outrageous",
"swift",
"bath",
"room",
"pocket",
"front",
"flower",
"quicksand",
"mark",
"sturdy",
"resolute",
"letters",
"expert",
"hapless",
"bloody",
"blue-eyed",
"hope",
"chew",
};
}