Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- # myshell.sh
- echo "welcome to use $0"
- echo "your target is $1"
- Hello(){
- echo "welcome to the summoner's rift"
- }
- Hello;
- ans=$1
- start=1
- end=10
- dex=1
- while [ $dex -lt 10 ]; do
- echo "Plese enter a number between $start and $end:"
- read input
- if [ $input -gt $end ]; then
- echo "wrong input!"
- elif [ $input -gt $ans ]; then
- end=`expr $input - 1`
- elif [ $input -lt $ans ]; then
- start=`expr $input + 1`
- else
- echo "BINGO!"
- break
- fi
- dex=`expr $dex + 1`
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement