Purpose of main() function

Purpose of main function

Friday, March 11, 2022
5:35 PM

I believe in the main you are first setting variables. First variable being difficulty setting it to 2, and second variable maxDifficulty setting it to 10. Underneath your set variables you are inserting a while loop, while the difficulty is less than the max difficulty the player advances to the next difficulty until reaching the max. Once player completes max difficulty the message “Wow - You’re a master hacker!” will be output to the display.

1 Like

Welcome to the forum!

Thank you! I’m happy to be here.

I believe the purpose of the min function is to “drive” the sequential processes of the game/program. In this main function, variables pertaining to difficulty settings are being set and then increased based on a condition set by the while loop

Thank you for your input, I really appreciate your help in learning.

Privacy & Terms