Groovy web console

subscribe to the feed Subscribe
to this

HP Generator

Published 1 month ago by Victory
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
public String teamInfo(String name, String[] comments)
    // Use Random class to pick a comment from array ^
    Random rnd = new Random();   
    return comments[rnd.nextInt(comments.size())];

String[] teamNames = ["Luke","Kristel","Sarah","Ana","Adam","Damien","Jaiden"];
String[] teamComments = ["a Prefect","a Headmaster","a Professor","a Squib", "a Student", "a Groundskeeper", "a Mudblood", "a Wandmaker", "a First-Year",
                         "In the Holyhead Harpies", "hosting voldemort on the back of their head", "A ghost", "a portrait", "a suit of armour",
                         "a potioneer", "from Durmstrang", "From Beauxbatons Academy", "a dragon", "a werewolf",
                         "an auror", "a hippogriff", "an animagus", "cho chang in disguise", "KILLGEORGE", "A Death Eater",
                         "the chosen one", "the boy who lived", "neville", "Horcrux", "harry potter's scar", "Secret Gay Dumbledore",
                         "a cerberus", "a unicorn", "a basilisk", "as irritating as colin creevy", "a dementor", "a demiguise",
                         "a pixie", "is hungry", "full of worms", "puking slugs", "lacking in arm bones", "brewing Felix Felicis",
                         "being oblivated by lockhart", "is being punished by umbridge", "a goblin", "a troll in the dungeon (thought you ought to know)",
                         "a house-elf", "a sock", "the sorting hat","a merfolk"];

// For each name in teamNames, append a random trait
for (int i = 0; i < teamNames.size(); i++){
    println (teamNames[i] + " is " + teamInfo(teamNames[i],teamComments));