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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started