Here is my latest version of the BullCow game but I may add more features when I have spare time. I thought it was a little harsh that the player would lose points because they guessed something that was not an isogram or had the incorrect number of letters. I decided to fix that by adding a new function called IsValidGuess. It returns a boolean and an out parameter called problems. This gives us an FString that tells us why the player’s input is not valid. I wanted to concatenate it because I think it looks better when the bullet points are added after it says “Sorry, that was not a valid guess.”
However I am having a small problem where %i is not being replaced by HiddenWord.Len() when being passed into the FString function. Down below you’ll see that it reads “* Your guess has to be %i characters long.” I’m guessing that you have to do something special with FString since you did not override the method like PrintLine(). I tried passing the string into FString::printf() but the number that replaced %i was a large number in the hundred thousand range. I decided to not dwell on the problem right now. Hopefully as I continue to follow this course, and learn more about C++, I’ll be able to solve the problem. But if you know the answer I’d be grateful if you told me how to solve it.
My Code:
BullCow changes: