Skip to main content
edited body
Source Link
user19214
user19214

BASH - 167 165 148

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:

mb3 output


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 260263 261 263260 236

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

BASH - 167 165 148

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:

mb3 output


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

BASH - 167 165 148

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:

mb3 output


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 - 263 261 260 236

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

edited body
Source Link
user19214
user19214

BASH - 167 165 148

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*yy*y>>12)>>12+h+h,y=(x*y>>11)+g,x=v));}
printf $[i%10]
'

(no trailing newline)

Run it in a terminal with line length 125:

mb3 output


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

BASH - 167 165 148

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:

mb3 output


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

BASH - 167 165 148

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:

mb3 output


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

deleted 18 characters in body
Source Link
user19214
user19214

BASH - 167 165 150148

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>>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

mb3 output


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

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

BASH - 167 165 148

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:

mb3 output


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

deleted 48 characters in body
Source Link
user19214
user19214
Loading
deleted 9 characters in body
Source Link
user19214
user19214
Loading
corrected c&p error: aded lost last line
Source Link
user19214
user19214
Loading
$g $h --> g h    :-)
Source Link
user19214
user19214
Loading
added 43 characters in body
Source Link
user19214
user19214
Loading
added 33 characters in body
Source Link
user19214
user19214
Loading
now bash's {start..end..inc} construct to unroll the 2 outer loops for using eval thereafter
Source Link
user19214
user19214
Loading
deleted 7 characters in body
Source Link
user19214
user19214
Loading
deleted 7 characters in body
Source Link
user19214
user19214
Loading
deleted 12 characters in body
Source Link
user19214
user19214
Loading
deleted 5 characters in body
Source Link
user19214
user19214
Loading
deleted 24 characters in body
Source Link
user19214
user19214
Loading
added 146 characters in body
Source Link
user19214
user19214
Loading
dramatic improvements ;-)
Source Link
user19214
user19214
Loading
deleted 5 characters in body
Source Link
user19214
user19214
Loading
added 9 characters in body
Source Link
user19214
user19214
Loading
added 9 characters in body
Source Link
user19214
user19214
Loading
Source Link
user19214
user19214
Loading