So far I think I got the extra credit. Slight problem edit: Fixed!

In order to set up a map of hidden words i ended up creating void HiddenWordBank(int32) and pulled out MyHiddenWord from reset. seen here:

I then made a function in main.cpp for asking the user to enter a number 3 - 7. seen here.Capture1

Afterwards, I went over to PrintIntro() and removed the BCGame.GetHiddenWordLength() as I placed GetGameDifficulty(); after PrintIntro(); and before PlayGame(); seen here (ignore nonsense :smiley: )

My problem, I think, lies in the cin not clearing the buffer as we learned in a previous lesson. I did some research and found that int32 won’t work with getline(). I am wondering where to go from here. It works great other than the uglyness you see here:


My GitHub repo
edit: I am looking into using stoi or string to integer in order to use getline() then change to an integer.
HERE’S IT FINISHEDCapture4
and running

Hi there! I have done something very similar to you however i cannot clear the error message when i first enter the word length it comes up with the enter all lowercase player warning and uses it as a try and i cannot work out why.

follow into the lectures a bit more when Ben mentions implicit dependencies(?). I am unsure without your code, but my intuition is telling me its because it’s going through the error messages one at a time on the enum we created/where we made the if statements for each. <- it might be going through and dropping into that. I cannot help you find a solution atm as I am busy making the tank barrel move 2 sections ahead. :slight_smile:. Upload your code to github or zip it up for me and I might take a look to help me out as well as you.

Wow very nice! Mine is similar but i handled the exceptions with another enum. Is still a little buggy but ill post it when is done.Just one thing…what would happend if the user type a word in that code?

It would crash. I think I fixed that aspect as well at a later time. Ah yes, I later added this because I couldn’t think of any way to handle it. Made it so that It had to be 3 4 5 6 or 7. The ^ is an XOR (if neither or both of them are equal to 1 the result is 0.) Definitely needs to be fixed up as these are magic numbers (I can’t change them without going back and fixing all this up). But this was my quick fix to the problem.

I see, well done.Im gonna try and make my code using those char comparisons, never thought of it lol, maybe with a loop too shorten it a little.Also a thing…isnt FText for output only?

I believe it is, yes. I may have misinterpreted what Ben was talking about when we set up the using / #define. I simply took it as main.cpp use FText =std::string, FBullCowGame use FString =std::string. Something along those lines. :slight_smile:

Privacy & Terms