You and your team of Year 12 agents are on a top-secret mission. A critical artefact is hidden inside a high-tech safe that only opens with a two-number code. This safe is designed to prevent brute-force attacks — if you guess the code incorrectly, the safe locks itself for 10 seconds, and you must wait before attempting another guess. Time is ticking, and your mission depends on retrieving the artifact before it’s too late.
Your mission:
1. Write Python code to simulate the safe.
2. Generate two random numbers as the secret code (between 1 and 99) when the program starts.
3. Prompt the user to enter the two-number code.
4. If the code is incorrect, display a message and implement a 10-second lockout before allowing another attempt.
5. If the user guesses correctly, congratulate them and end the program.
Good luck, agents!
Extension:
1. Hint System: Add an optional feature that provides hints, such as whether the guessed numbers are too high or too low.
2. Time Tracking: Measure how long it takes the user to crack the code and display the total time at the end.
3. Attempts Counter: Track the number of attempts and display it when the safe is unlocked.