Guess game done
This commit is contained in:
parent
924196de1f
commit
c477b99571
18
2023.05.22_zajęcia_asynchroniczne/guess.sh
Executable file
18
2023.05.22_zajęcia_asynchroniczne/guess.sh
Executable file
@ -0,0 +1,18 @@
|
|||||||
|
echo "Guess game. What is the number I'm thinking about?"
|
||||||
|
|
||||||
|
num=$(($(($RANDOM % 20))+1))
|
||||||
|
|
||||||
|
ex=1
|
||||||
|
while [ 1 -eq $ex ]
|
||||||
|
do
|
||||||
|
read usr
|
||||||
|
|
||||||
|
if [ $num == $usr ]
|
||||||
|
then
|
||||||
|
echo "Great it is $num"
|
||||||
|
ex=0
|
||||||
|
else
|
||||||
|
echo "No, it is not that number"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
Loading…
Reference in New Issue
Block a user