Question
Write a shell script guess.sh that emulates a simple number guessing game. Your script should: Define a random integer in the range of 1 to
Write a shell script "guess.sh" that emulates a simple number guessing game. Your script should: Define a random integer in the range of 1 to 64 (inclusive) for the user to guess. Display a welcoming message to the user. Prompt the user to guess a number between 1 to 64 (inclusive). Provide a hint to the user each time he/she enters a guess by displaying a message that reads "Too small." or "Too big." accordingly. If a correct guess is entered then display the message "You won!" and exit. Allow the user to guess a maximum of 6 times. After the 6th attempt display a message "You lost!" and exit
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