Bull & Cows

My Finished Bulls & Cows Game

FBullCowGame.zip (4.2 KB)

//Updated to fix a bug in the IsLowerCase(FString) method

Hi there!

I just finished play testing your game and mostly everything is working great! The only thing you need to do is look into your IsLowerCase() function. Currently you are returning after the loop has been completed. This makes it so the check is only looking at the last character in the guess. Even if an upper case letter is found earlier in the word, as long as the last letter is lowercase your code will currently accept that as a valid guess.

You need something to break out of your loop if you find an uper case character.

Thanks for checking it out, It was actually an older version, i thought i had already updated the zip. Oh well, the fix is:

bool FBullCowGame::IsLowerCase(FString TheGuess) const//Checks the guess for CAPITALS
    for (auto Letter : TheGuess)
	    if (!islower(Letter)) { return false; }
    return true;

This was actually the topic of this post here

ill have to make sure i upload the correct version this time. :expressionless:

Privacy & Terms