What I think main() does

The main() function starts by declaring 2 variables for difficulty the current difficulty and the max difficulty. int difficulty = 2;
int maxDifficulty = 10;
The semi-colons indicate the end of a statement
Then the while loop is called and will continue to call the PlayGameAtDifficulty() function until difficulty (which gets incremented after each cycle) is greater than maxDifficulty when the while loop is finished the player wins the game and is greeted with some congratulatory text!

I’m not 100% sure on the cin statements inside the while loop though but other than that I got it.

1 Like

Privacy & Terms