我是
靠谱客的博主
糟糕皮卡丘,这篇文章主要介绍
这是我见过最牛逼的shell代码,现在分享给大家,希望可以做个参考。
#!/bin/bash
APP_NAME="${0##*[\/]}"
APP_VERSION="1.0"
iSumColor=7
cRed=1
cGreen=2
cYellow=3
cBlue=4
cFuchsia=5
cCyan=6
cWhite=7
marginLeft=3
marginTop=2
((mapLeft=marginLeft+2))
((mapTop=$marginTop+1))
mapWidth=10
mapHeight=15
cBorder=$cGreen
cScore=$cFuchsia
cScoreValue=$cCyan
sigRotate=25
sigLeft=26
sigRight=27
sigDown=28
sigAllDown=29
sigExit=30
box0_0=(0 0 0 1 1 0 1 1 0 4)
box1_0=(0 1 1 1 2 1 3 1 0 3)
box1_1=(1 0 1 1 1 2 1 3 -1 3)
box2_0=(0 0 1 0 1 1 2 1 0 4)
box2_1=(0 1 0 2 1 0 1 1 0 3)
box3_0=(0 1 1 0 1 1 2 0 0 4)
box3_1=(0 0 0 1 1 1 1 2 0 4)
box4_0=(0 2 1 0 1 1 1 2 0 3)
box4_1=(0 1 1 1 2 1 2 2 0 3)
box4_2=(1 0 1 1 1 2 2 0 -1 3)
box4_3=(0 0 0 1 1 1 2 1 0 4)
box5_0=(0 0 1 0 1 1 1 2 0 3)
box5_1=(0 1 0 2 1 1 2 1 0 3)
box5_2=(1 0 1 1 1 2 2 2 -1 3)
box5_3=(0 1 1 1 2 0 2 1 0 4)
box6_0=(0 1 1 0 1 1 1 2 0 3)
box6_1=(0 1 1 1 1 2 2 1 0 3)
box6_2=(1 0 1 1 1 2 2 1 -1 3)
box6_3=(0 1 1 0 1 1 2 1 0 4)
iSumType=7
boxStyle=(1 2 2 2 4 4 4)
iScoreEachLevel=50
sig=0
iScore=0
iLevel=0
boxNext=()
iboxNextColor=0
iboxNextType=0
iboxNextStyle=0
boxCur=()
iBoxCurColor=0
iBoxCurType=0
iBoxCurStyle=0
boxCurX=-1
boxCurY=-1
map=()
for ((i = 0; i < mapHeight * mapWidth; i++))
do
map[$i]=-1
done
function RunAsKeyReceiver()
{
local pidDisplayer key aKey sig cESC sTTY
pidDisplayer=$1
aKey=(0 0 0)
cESC=`echo -ne "