init/scripts/03

13 lines
382 B
Plaintext
Raw Permalink Normal View History

2020-11-22 16:17:08 +00:00
((nbr=$RANDOM % 100 + 1))
guess=-1
echo "Find the mystery number (between 1 and 100) !!!"
while ((guess != nbr)); do
read -p 'Enter a number : ' guess
if (( guess < nbr )); then
echo "Mystery number is superior to the input number."
elif (( guess > nbr )); then
echo "Mystery number is inferior to the input number."
fi
done
echo "Congrats ! You found the mystery number !"