shellcheck
This commit is contained in:
parent
a242bc42e2
commit
6ef757bc8b
1 changed files with 7 additions and 7 deletions
14
banana.sh
14
banana.sh
|
@ -10,16 +10,16 @@ v=$num
|
||||||
st=
|
st=
|
||||||
length=0
|
length=0
|
||||||
|
|
||||||
idx=$((($numalpha - 1) % $numalpha))
|
idx=$(((numalpha - 1) % numalpha))
|
||||||
while !( [ $v -eq 0 ] && [ $idx -eq $((($numalpha - 1) % $numalpha)) ] && [ $length -ge $minlength ] )
|
while ! { [ "$v" -eq 0 ] && [ $idx -eq $(((numalpha - 1) % numalpha)) ] && [ $length -ge $minlength ] ; }
|
||||||
do
|
do
|
||||||
al=${alphabets[idx]}
|
al=${alphabets[idx]}
|
||||||
r=$(($v % ${#al}))
|
r=$((v % ${#al}))
|
||||||
v=$(($v / ${#al}))
|
v=$((v / ${#al}))
|
||||||
st="${al:$r:1}$st"
|
st="${al:$r:1}$st"
|
||||||
|
|
||||||
idx=$((($idx + $numalpha - 1) % $numalpha))
|
idx=$(((idx + numalpha - 1) % numalpha))
|
||||||
length=$(($length + 1))
|
length=$((length + 1))
|
||||||
done
|
done
|
||||||
|
|
||||||
echo $st
|
echo "$st"
|
||||||
|
|
Loading…
Reference in a new issue