グルグルなシェル芸

  ImageMagick

概要

グルグルさせます。

シェル芸

p=images/a.png
c=convert
$c xc:[99x99] $p
x=50
y=49
m=3
i=1
for i in {1..99};do
a=$x
b=$y
if((i%4==1));then
m=$((m+3))
a=$((a+m))
elif((i%4==2));then
b=$((b-m))
elif((i%4==3));then
m=$((m+3))
a=$((a-m))
else
b=$((b+m))
fi
$c $p -draw "line $x,$y $a,$b" $p
x=$a
y=$b
done

出力結果

LEAVE A COMMENT