I am making a hang-man sort of a game. Currently, I imported a .txt dictionary. I am trying to compare a guess array to the word array. Both arrays are char data types. However, using blueJ I can tell that both arrays are identical but the if(workWord.equals(realWord)) is not executing.
while(togLoop) {
System.out.print("Please enter a guess! ");
char input = keyboard.next().charAt(0);
for(int i = 0; i < wordGuess.length();i++) {
if(realWord[i] == input){
correct += 1;
System.out.println("It is the " + (i + 1) + " letter");
workWord[i] = input;
}
}
if(workWord.equals(realWord)) {
System.out.println("Congrats! You got it right!");
togLoop = false;
}
}