The Main() function is where the primary code is run.
You instance two variables; difficulty, and max difficulty, where a function is called (PlayGameAtDifficulty) in a while loop, which receives a parameter in this case, the difficulty variable, at the end you increment the value of difficulty by one so the program would not be stuck at an infinity loop.