so what i am supposed to be doing, is the user inputs a letter and the program checks to see if the letter is part of the word, from there i cant figure out what i code i need to use to make one of the letters reveal itself heres what i have so far
do {
System.out.println("Word: " + secretWord.getWordMask());
//System.out.print("Guesses: " + guesses);
System.out.print("Enter your guess: ");
Scanner keyboard = new Scanner(System.in);
String guess = keyboard.next();
WordHider revealChar = new WordHider();
System.out.println(revealChar.revealLetter(guess));
//if (secretWord.revealLetter(guess));
} while (secretWord.isHiddenWordFound());
and this is another part of a class that i was given in which i have to figure out how to call it a method and implement it
public int revealLetter(String letter) {
int count = 0;
String newFoundWord = "";
if (letter.length() == 1) {
for (int i = 0; i < secretWord.length(); i++) {
if ((secretWord.charAt(i) == letter.charAt(0))
&& (wordMask.charAt(i) == HIDE_CHAR.charAt(0))) {
count++;
newFoundWord += letter;
}
else {
newFoundWord += wordMask.charAt(i);
}
}
}
wordMask = newFoundWord;
return count;
my main problem is right in the first section where i have WordHider revealChar = new WordHider();
System.out.println(revealChar.revealLetter(guess));
what that is supposed to do is reveal i letter but its definitely not right, any ideas?