Hi all,
For some reason my bGameIsWon is not triggering to be true after I enter the correct isogramic word. This happens with isograms of any length.
I was expecting the game to complete, and for the AskToPlayAgain() method to trigger, but the while loop in PlayGame() continues. The tries are incremented, and it prompts the user to enter enother guess, although the number of Bulls displayed is the same number of letters as there are in the hidden word.
This may have been unnecessary, but I added a temporary method in the FBullCowGame class called GetHiddenWord() to directly compare the hidden isogram to the guessed word.
I am directly setting the boolean bGameIsWon in the SubmitValidGuess() method, after both for loops, before the return statement.
bGameWon = (BCCount.Bulls == HiddenWordLength);
return BCCount;
Attached is an image of output when the hidden word is “planet”. Note the output includes extra debug std::cout statements which provide the value of BCGame.IsGameWon(), and compares the values of Guess to BCGame.GetHiddenWord().
Any advice would be appreciated,
Thank you