Hi,
Reached the end of the Triplex section of the updated course and I’m trying to further improve the game now it’s completed while waiting for the next updated section, however, 1 of the first things I wanted to do was add a guess limit but I just can’t seem to get it to work properly. I’ve tried using FOR in multiple places but most of the time either it has no effect or makes it so even if you give the right answer it’ll continue wanting you to add in more guesses until you hit the guess limit.
Is there something else you need to add in so that it’ll have the set number of guesses but recognise when you’ve got the right answer and increase the difficulty or am I just placing things in the wrong order? Best result so far has been the below but that’s the one that makes it take the full 5 guesses before moving on. I can see the issue is that it’s just being told to take the guesses until it hits 5 but tried adding an OR to the IF and that just seemed to make it not even know if the code was right or not
int GuessA, GuessB, GuessC;
int MaxGuesses = 5;
for (size_t i = 1; i <= MaxGuesses; i++)
{
std::cin >> GuessA >> GuessB >> GuessC;
std::cout << std::endl;
}