Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- usr=$RANDOM
- num=$RANDOM
- clear
- compare()
- {
- if [[ "$usr" -ne "$num" ]]; then
- if [[ "$usr" -lt "$num" ]]; then
- echo "Больше"
- echo
- return 1
- else
- echo "Меньше"
- echo
- return 1
- fi
- return 0
- fi
- }
- echo "Первая догадка:"
- while [ "$usr" -ne "$num" ]; do
- read usr
- compare && echo "Правильно!"
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement