-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathguessinggame.sh
46 lines (41 loc) · 914 Bytes
/
guessinggame.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
echo ":_:_:_:_:_:_:_:_:_:_:_"
echo "Hello and welcome to this guessing game"
echo ":_:_:_:_:_:_:_:_:_:_:_"
echo ""
sleep 2
echo -ne "The big question is\r"
sleep 0.6
echo -ne "The big question is: how many files\r"
sleep 0.6
echo -ne "The big question is: how many files are there\r"
sleep 0.6
echo -ne "The big question is: how many files are there in the current directory?"
echo ""
sleep 2
function fff {
echo "HAHAHA";
}
function fcounter {
echo $(ls | wc -l);
}
aaa=1
while [[ $aaa -eq 1 ]]
do
echo "enter some figure"
read response
echo "You entered: $response"
if [[ $response -eq `eval fcounter` ]]
then
sleep 2
echo "BIG YES!!!"
aaa=0
elif [[ $response -lt `eval fcounter` ]]
then
echo "your answer is too low: less than the # of files"
elif [[ $response -gt `eval fcounter` ]]
then
echo "your answer is too high: greater than the # of files"
fi
done
fff