Answered step by step
Verified Expert Solution
Question
1 Approved Answer
3. Write a bash script called guess.sh that plays the number guessing game. It is a game where one person thinks of a number between
3. Write a bash script called guess.sh that plays the number guessing game. It is a game where one person thinks of a number between 1 and 100, then the guesser guesses the number. The first person then tells the user if the correct answer is higher or lower than their guess. 1 In our case the person thinking of the number will be a bash script. Below are the rules of the game that you need to take into consideration: a. The script will choose a random number from 1 to 100 and ask the user to guess the number. b. The user enters their guess. C. The script determines if the answer is higher, lower or correct. d. If the correct answer is higher or lower than the guess informs the user (higher or lower) and let them guess again. e. Keep track of the number of guesses. f. If the answer was correct let the user know how many guesses it took to get the correct answer. HINT: Use the bash function SRANDOM to get a random number
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