码迷,mamicode.com
首页 > 其他好文 > 详细

~图形脚本加(双色球小脚本)*

时间:2019-08-31 12:27:01      阅读:64      评论:0      收藏:0      [点我收藏+]

标签:tin   dev   乘法口诀   dom   图形   div   null   三角形   $?   

#!/bin/bash
#99乘法口诀
for i in {1..9}
do
        for j in {1..9}
        do
                if [ $j -le $i ]
                then
                        echo -n " ${j}x${i}=$(($i*$j)) "
                fi
        done
        echo
done
echo
echo
#三角形  变  M 形
for ((i=1;i<=9;i++))
do
        for ((j=1;j<=$i;j++))
        do
                echo -n "*"
        done
        for ((j=1;j<=$i;j++))
        do
                echo -n " "
        done
        for ((j=9;j>=$i;j--))
        do
                echo -n " "
        done
        for ((j=1;j<=$i;j++))
        do
                echo -n " "
        done
#隔开
        for ((j=9;j>=$i;j--))
        do
                echo -n "*"
        done
        for ((j=1;j<=$i;j++))
        do
                echo -n "*"
        done
        for ((j=1;j<=$i;j++))
        do
                echo -n " "
        done
        for ((j=9;j>$i;j--))
        do
                echo -n "*"
        done
        for ((j=9;j>=$i;j--))
        do
                echo -n "*"
        done
         for ((j=1;j<=$i;j++))
        do
                echo -n " "
        done
        for ((j=9;j>=$i;j--))
        do
                echo -n "*"
        done
        for ((j=1;j<=$i;j++))
        do
                echo -n "*"
        done
        echo
done
echo
echo
#金字塔形
for ((i=1;i<=9;i++))
do
        for ((j=9;j>=$i;j--))

        do
                echo -n " "
done
        for ((j=1;j<=$i;j++))
        do
                echo -n "*"
        done
        for ((j=1;j<$i;j++))
        do
                echo -n "*"
        done
        echo
done
 

echo
echo
#长方形
for ((i=1;i<=9;i++))
do
        for ((j=9;j>=$i;j--))

        do
                echo -n "*"
done
        for ((j=1;j<=$i;j++))
        do
                echo -n "*"
        done
        echo
done
echo
echo
#结束了
#双色球
echo "第19100期开奖结果 开奖日期:$(date +‘%F %T‘)"
touch /number
aa=0
for ((i=1;${aa}<6;i++))
do
        num=$(expr $RANDOM % 33 + 1)
        cat /number | grep $num  &> /dev/null
        if [ $? -ne 0 ]
        then    echo "$num" >> /number
                echo -en "\033[31m$num \033[0m"
                let aa++
        else continue
        fi
done
echo -en "\033[34m$(expr $RANDOM % 16 + 1)\033[0m"
echo
rm -rf /number

#结束了

~图形脚本加(双色球小脚本)*

标签:tin   dev   乘法口诀   dom   图形   div   null   三角形   $?   

原文地址:https://www.cnblogs.com/123456likun/p/11438493.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!