From c477b995716e45adbadea34e653de4327bba27c1 Mon Sep 17 00:00:00 2001 From: Arkadiusz Hypki Date: Mon, 29 May 2023 17:49:04 +0200 Subject: [PATCH] Guess game done --- 2023.05.22_zajęcia_asynchroniczne/guess.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 2023.05.22_zajęcia_asynchroniczne/guess.sh diff --git a/2023.05.22_zajęcia_asynchroniczne/guess.sh b/2023.05.22_zajęcia_asynchroniczne/guess.sh new file mode 100755 index 0000000..b312243 --- /dev/null +++ b/2023.05.22_zajęcia_asynchroniczne/guess.sh @@ -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 +