num=$((RANDOM % 50 +1))
guess=1
read -p "please guess number:" usrnum
while [ $num -ne $usrnum ]
do
if [ $usrnum -gt $num ] ;then
echo "too big"
else
echo "too small"
fi
read -p "please guess number:" usrnum
guess=$(( guess + 1))
done
echo "you guess $guess times to get right answer:$num"
我会