need help with this java code
hi I've done this java code to make the computer guess a random word from the array
Code:
import java.util.*;
// bluej is actually a bad name of a class because it should start with capital letter.
public class WordGuesser {
public void main(String[]args) {
System.out.println("start");
ArrayList words = new ArrayList();
words.add("hello");
words.add("car");
words.add("dog");
words.add("plane");
words.add("plant");
words.add("help");
words.add("job");
words.add("java");
words.add("blue");
words.add("bathroom");
Die die = new Die(words.size());
System.out.println(die);
boolean isCorrect = false;
while(!isCorrect) {
System.out.println("What word am I thinking of?");
String guess = ""; // read in guess using System.in
isCorrect = die.equals(guess);
if(!isCorrect) {
System.out.println("Sorry that wasn't correct.");
} else {
System.out.println("That's correct. I was thinking of " + die);
}
}
System.out.println("finish");
}
}
I need help to make the computer guess the word letter by letter
please help cause I'm not that great on java just started learning it a month ago