Skip to main content
18 of 21
deleted 48 characters in body
user avatar
user avatar

BASH - 167 165 150

The mb3 file:

eval g={-4096..4096..199}'
'h={-8192..4096..99}'
x=;y=;for((i=0;i<30&&x*x+y*y<1<<26;i++)){((v=((x*x-y*y)>>12)+h,y=(x*y>>11)+g,x=v));}
printf $[i%10]
'

(no trailing newline)

Run it in a terminal with line length 125:

enter image description here

BASH - 214 190

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));((y=((x*y)>>11)+h))
x=$v
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 - 236 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))
((y=((x*y)>>11)+h));x=$v
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