Hi, having some difficulty figuring out why the attempt to have a random adverb, verb, and noun isn't working. I'm aware of some repeated and unnecessary code as I've just been grasping at straws. So any input is appreciated. Also, would we need anything in the world class?
(as of now I just want the code to show the text on the screen.
WORDS CLASS public class Words extends Actor { String text; public void act(){ word(); GreenfootImage(); } public static String[] getAdv(){ String[] adv = {"eerily", "spookily", "weirdly", "frighteningly", "uncannily", "creepily", "ghostily", "mysteriously", "chillingly", "scarily", "sinisterly", "eerily", "hauntingly", "terrifyingly", "supernaturally", "disturbingly", "ominously", "dreadfully", "putridly", "repulsively", "distressingly", "menacingly", "deliberately" }; return adv; } public static String[] getNoun(){ String[] noun = {"Mr. Eaton", "Spencer", "Daniel", "Other Spencer", "ghost", "dinosaur", "frederick", "Colonel Sanders", "zombie", "wight", "skeleton", "bones", "flesh", "witch", "Obama", "Yoda", "cartilidge", "Julius Ceasar", "Ben Shapiro", "ZUckerberg", "dr Phil" }; return noun; } public static String[] getVerb(){ String[] verb = { "bite", "petrify", "howl", "horrify", "murder", "murder", "panic", "carve", "collect", "creep", "curse", "curdle", "scare", "possess", "spook", "startle", "frighten", "terrorize", "vex", "haunt", "destroy", "consume", "devour", "degrade", "dissect", "decompose" }; return verb; } public String GreenfootImage(java.lang.String string, int size, Color foreground, Color background, Color outline){ string = text; size = 100; foreground = Color.WHITE; background = Color.BLACK; outline = Color.BLACK; } public Image(String text){ setImage(new GreenfootImage(text, 50, Color.RED, Color.YELLOW, null)); } public String word(){ text = getAdv()[Greenfoot.getRandomNumber(getAdv().length)] + getVerb()[Greenfoot.getRandomNumber(getVerb().length)] + getNoun()[Greenfoot.getRandomNumber(getNoun().length)]; } }