What I think the Main() does in the Triple X code

int main()  // Define main method without parameter
{
    /* Define a variable called 'difficulty' of data type integer and 
       assign it the value of 2*/

    int difficulty = 2; 

     /* Define a camel case variable callled 'maxDifficulty' of data type 
        integer and assign it the value of 10*/

    int maxDiffuculty = 10;

     

     /* Define a while loop - While the 'difficulty' variable is less than or 
        equal to the 'maxDifficulty' variable, invoke the clear() and 
        ignore() methods. Then increment the difficulty variable by 1 
        before the loop repeats the procedure.*/

    while (difficulty <= maxDifficulty) 
    {
        /* Invoke the PlayGameAtDifficulty method and pass in the 
           'difficulty' variable as an argument*/

        PlayGameAtDifficulty(difficulty);

        /* The clear() and ignore methods are defined in the same 
           name space; std::cin*/
  
        std::cin.clear(); // Clear the console??
        std::cin.ignore(); // Ignore the console??
        ++difficulty;
    }

    /* Print - "Wow!  - You're a master hacker! " to the console once 
       the condition is met in the above while loop*/
    std.cout << "Wow!  - You're a master hacker! \n";

    /* Return a value at the end of the method to not throw an error. */
    return 0;
}

Privacy & Terms