Main challenge

I know a little about C++ and programming in general, so that helps. I still can’t make anything really though at the moment. So the first two are declaring two variables, setting the difficulty up to 2 to start with, with the max level being set for 10. Next is a while statement to check if the currently difficultly is at or below the max, which is 10. I would assume once you reach level 10 you win the game. During the while loop it runs the play game function, which would be found elsewhere in the code, and is passes on the difficulty level for that function. It also has some cin (input) calls that clears the fail bit and discards the buffer so it’s ready for your input. Finally (assuming you don’t die in that level) it increments the difficulty by one with the ++difficulty. Therefore the difficulty variable will change from 2 to 3, which will repeat until you reach 10.

Privacy & Terms