Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- min=0 max=100
- while true; do
- guess=$((RANDOM%(max-min+1)+min))
- echo Is your number $guess?
- select choice in Yes Lower Higher; do
- case $choice in
- Yes)
- echo Your number is $guess
- exit 0;;
- Lower)
- max=$guess;;
- Higher)
- min=$guess;;
- esac
- break
- done
- done
Add Comment
Please, Sign In to add comment