#!/bin/bash
echo '提示:请在0-9里选一个数字输入'
while :
do
N=5
read -p 'please input a number:' n
if [ $n -gt $N ]
then
echo 'the number is too big'
echo '凉了呀,马飞!!!'
elif [ $n -lt $N ]
then
echo 'the number is too small'
echo '难受啦,马飞!!!'
elif [ $n -eq $N ]
then
echo 'Winner Winner Chicken Dinner'
echo '大吉大利,今晚吃鸡'
break
fi
done
基于shell写的猜数字游戏
最新推荐文章于 2022-12-27 22:15:02 发布