For loop code

Here’s the code that I used to run the for loop that would call the GetGuess (or GetGuessAndPrintBack) method until the user would run out of tries. I used a variable for the maximum amount of tries, initialized the counter to that variable, and used the constant number of 0 as the condition, since we always want the loop to stop when the user has reached 0 tries.

Privacy & Terms