From the course: Learning Linux Shell Scripting
Unlock the full course today
Join today to access over 24,400 courses taught by industry experts.
Challenge: Guessing game - Linux Tutorial
From the course: Learning Linux Shell Scripting
Challenge: Guessing game
- [Narrator] Let's create a simple version of a guessing game. Create a script, guess.sh. In it, set a global variable named COMPUTER to any number one to 50. Use the READ command to prompt the user for input. If their value matches the COMPUTER, let them know that they won and exit. Else, let them know if they're too high or too low compared to the COMPUTER's number.
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.