import java.util.Arrays; import java.util.Collections; import java.util.ArrayList; //Fra 26.05.2021 class SetningKlasse2{ ArrayList ordListe = new ArrayList(Arrays.asList( "scold", "medical", "sister", "apparatus", "productive", "potato", "heat", "tame", "flame", "new", "noisy", "remove", "cup", "iron", "chubby", "ragged", "stingy", "songs", "available", "quiver", "wandering", "broad", "airplane", "tiger", "mountain", "sign", "scarf", "glove", "fearless", "earn", "engine", "horses", "mark", "boorish", "hallowed", "drip", "quiet", "rice", "obsequious", "ticket", "dysfunctional", "jaded", "close", "swing", "gate", "balance", "tricky", "attempt", "entertaining", "pig", "smoggy", "riddle", "shade", "handle", "unhealthy", "rescue", "dam", "versed", "print", "supply", "scare", "hospital", "sand", "nerve", "shiny", "moan", "cattle", "unsightly", "talk", "tasty", "experience", "toes", "puzzling", "extend", "loose", "unused", "fold", "buzz", "ubiquitous", "shiver", "nice", "tall", "science", "irritate", "imported", "mature", "bikes", "selfish", "youthful", "heavenly", "zinc", "analyze", "provide", "instrument", "building", "hateful", "plucky", "retire", "dare", "nostalgic")); public String byggSetning(){ int teller = 0; String setning = ""; return bygg(teller,setning); } public String bygg(int teller, String setning){ if(teller == 5){ return setning + "."; } else{ Collections.shuffle(ordListe); String nySetning = setning + " " + ordListe.get(0); teller = teller + 1; return bygg(teller,nySetning); } } }