My BCGame: word request to user (simple)

I just implemented a feature to change the word so you can actually play it with friends.
I feel like I cheated because I called a function inside the switch, and I don’t like it, but I’ll let it sit and see what else I’ll come up with.
I decided to use noinput as the cue to change words. CheckGuessValidity triggers this. Sorry Ben! FeelsBadMan :disappointed_relieved:
Basically theres a Setter function that receives a string (a word candidate) and returns a bool (as a valid or invalid word) and if valid writes it on MyHiddenWord.
There’s a word request function on main, that prints out the word request on gui and calls the setter function.
The word needs to be initialized once outside loops, so I used the setter function to do it in the beggining of main.
Files: Source Pack


main.cpp changes:

SetNewWord before the main loop.

Call a word request if on a NoInput case

Request NewWord from user, if accepted, hide the input from the screen and re introduce the game.

FBullCowGame.cpp changes:

This part needs to be added on wrong length “&& !empty(Guess)” and ofc empty(Guess) itself on NoInput.

Remove const for HIDDEN_WORD

Ok maybe it could be simpler, but I like this way, I revisit it later.
Checks caps and letters, set the new word and return true for no error.

FBullCowGame.h changes:

Privacy & Terms