While loop not ending when condition changes

Hi guys! So, I’ve basically done both my own solution and the solution for the challenge in “handling the win condition”.
and my problem is that my bool bGameIsWon DOES change to true, but the while loop in main doesn’t stop.

I’ve looked over my code but can’t seem to find the problem. I’ve also tried rebuilding the solution if that’d’be the case and it still doesn’t solve the issue. Can someone please help?

In PlayGame, the for loop inside the while is not needed. Just remove that for, and then either have a new variable int32 currentTry = 1; before the while loop, and increment it in the while, or you can decrement maximum_tries and check for 0.

haha, I totally missed that x) It was enough with just removing the for loop. Thank you!

Privacy & Terms