I've got a program with a code lock, and I would like the program to restart when you enter the incorrect code. Does anyone know of a way to do that?
1 Answer
If I were you I'd use a loop inside the program. In this loop the prompt for entering the code would be displayed, then the user input would be read. Finally, the code would be checked and if correct, the proper action executed, otherwise a failure message would be shown and the execution would loop back to the start (display the prompt).