13 lines
382 B
Plaintext
13 lines
382 B
Plaintext
((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 !"
|