Skip to main content
10 of 21
deleted 7 characters in body
user avatar
user avatar

BASH - 195 214

for h in {-4096..4096..200};do
for g in {-8192..4096..115};do
x=0;y=0
for((i=0;i<30&&x*x+y*y<1<<26;i++));do((v=((x*x-y*y)>>12)+g));((w=((x*y)>>11)+h))
x=$v;y=$w
done;printf $[i%10];done;echo;done

This basically is the same code like below with calculations being replaced by hardcoded values and the image got flipped around the x axis.

mb2.bash run snapshot

The version below did not fully fit the rules breaking "from (-2 - i) to (1 + i)".


BASH - 241 260 261 263

Use this source, Luke:

a=-8601;b=2867;c=-4915;d=4915
((e=(b-a)/99));((f=(d-c)/49))
for((h=d;h>=c;h-=f));do
for((g=a;g<=b;g+=e));do
x=0;y=0
for((i=0;i<30&&x*x+y*y<1<<26;i++));do((v=((x*x-y*y)>>12)+g))
((w=((x*y)>>11)+h));x=$v;y=$w
done
printf $[i%10]
done;echo;done

This code uses integer arithmetic only, so BASH does not need additional helpers for doing floating point maths...

mb.bash run snapshot

user19214