Question: Create a script named lab6s5 that plays a game with the user. When a user executes the script, they must keep guessing the secret number
Create a script named lab6s5 that plays a game with the user. When a user executes the script, they must keep guessing the secret number until they successfully enter it. Here is an example interaction with the script. Make sure that your script behaves identically:
$ ./lab6s5 I am thinking of a number between 1 and 10. Enter your guess:3 The secret number is larger than your guess. Try again. I am thinking of a number between 1 and 10. Enter your guess:6 The secret number is smaller than your guess. Try again. I am thinking of a number between 1 and 10. Enter your guess:2 The secret number is larger than your guess. Try again. I am thinking of a number between 1 and 10. Enter your guess:5 Yes! 5 is the correct answer!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
