Skip to main content
added 3 characters in body
Source Link
Dominic van Essen
  • 37.2k
  • 2
  • 24
  • 61

R, 140 136 128 124 123 110110 109 bytes*

j=1image(outer(j<-1:396/99-2 image(outer(j,j,Vectorize(function(x,y,n=99){while((n=n-1)&abs(F)<2)F=F*F+x+1i*y;n})),c=colors()) 

Try it at rdrr.ioTry it at rdrr.io

6y after the Q was asked, but I love Mandelbrot sets, and the earlier R solution was 211 characters...

enter image description here

*Or just 62 bytes as a pixel-shader function in R≥4.1:
\(x,y,n=99){while((n=n-1)&abs(F)<2)F=F*F+x+1i*y;colors()[n+1]}

R, 140 136 128 124 123 110 bytes*

j=1:396/99-2 image(outer(j,j,Vectorize(function(x,y,n=99){while((n=n-1)&abs(F)<2)F=F*F+x+1i*y;n})),c=colors()) 

Try it at rdrr.io

6y after the Q was asked, but I love Mandelbrot sets, and the earlier R solution was 211 characters...

enter image description here

*Or just 62 bytes as a pixel-shader function in R≥4.1:
\(x,y,n=99){while((n=n-1)&abs(F)<2)F=F*F+x+1i*y;colors()[n+1]}

R, 140 136 128 124 123 110 109 bytes*

image(outer(j<-1:396/99-2,j,Vectorize(function(x,y,n=99){while((n=n-1)&abs(F)<2)F=F*F+x+1i*y;n})),c=colors()) 

Try it at rdrr.io

6y after the Q was asked, but I love Mandelbrot sets, and the earlier R solution was 211 characters...

enter image description here

*Or just 62 bytes as a pixel-shader function in R≥4.1:
\(x,y,n=99){while((n=n-1)&abs(F)<2)F=F*F+x+1i*y;colors()[n+1]}

added 474 characters in body
Source Link
Dominic van Essen
  • 37.2k
  • 2
  • 24
  • 61

R, 140 136 128 124 123 110 bytesbytes*

j=1:396/99-2 image(outer(j,j,Vectorize(function(x,y,n=99){while((n=n-1)&abs(F)<2)F=F*F+x+1i*y;n})),c=colors()) 

Try it at rdrr.io

6y after the Q was asked, but I love Mandelbrot sets, and the earlier R solution was 211 characters...

enter image description here

*Or just 62 bytes as a pixel-shader function in R≥4.1:
\(x,y,n=99){while((n=n-1)&abs(F)<2)F=F*F+x+1i*y;colors()[n+1]}

R, 140 136 128 124 123 110 bytes

j=1:396/99-2 image(outer(j,j,Vectorize(function(x,y,n=99){while((n=n-1)&abs(F)<2)F=F*F+x+1i*y;n})),c=colors()) 

Try it at rdrr.io

6y after the Q was asked, but I love Mandelbrot sets, and the earlier R solution was 211 characters...

enter image description here

R, 140 136 128 124 123 110 bytes*

j=1:396/99-2 image(outer(j,j,Vectorize(function(x,y,n=99){while((n=n-1)&abs(F)<2)F=F*F+x+1i*y;n})),c=colors()) 

Try it at rdrr.io

6y after the Q was asked, but I love Mandelbrot sets, and the earlier R solution was 211 characters...

enter image description here

*Or just 62 bytes as a pixel-shader function in R≥4.1:
\(x,y,n=99){while((n=n-1)&abs(F)<2)F=F*F+x+1i*y;colors()[n+1]}

added 215 characters in body
Source Link
Dominic van Essen
  • 37.2k
  • 2
  • 24
  • 61

R, 140 136 128 124 123 110 bytes

j=1:396/99-2 image(outer(j,j,Vectorize(function(x,y,n=99){while((n=n-1)&abs(F)<2)F=F*F+x+1i*y;n})),c=colors()) 

Try it at rdrr.io

6y after the Q was asked, but I love Mandelbrot sets, and the earlier R solution was 211 characters...

enter image description here

R, 140 136 128 124 123 110 bytes

j=1:396/99-2 image(outer(j,j,Vectorize(function(x,y,n=99){while((n=n-1)&abs(F)<2)F=F*F+x+1i*y;n})),c=colors()) 

6y after the Q was asked, but I love Mandelbrot sets, and the earlier R solution was 211 characters...

enter image description here

R, 140 136 128 124 123 110 bytes

j=1:396/99-2 image(outer(j,j,Vectorize(function(x,y,n=99){while((n=n-1)&abs(F)<2)F=F*F+x+1i*y;n})),c=colors()) 

Try it at rdrr.io

6y after the Q was asked, but I love Mandelbrot sets, and the earlier R solution was 211 characters...

enter image description here

deleted 3 characters in body
Source Link
Dominic van Essen
  • 37.2k
  • 2
  • 24
  • 61
Loading
added 4 characters in body
Source Link
Dominic van Essen
  • 37.2k
  • 2
  • 24
  • 61
Loading
added 9 characters in body
Source Link
Dominic van Essen
  • 37.2k
  • 2
  • 24
  • 61
Loading
added 7 characters in body
Source Link
Dominic van Essen
  • 37.2k
  • 2
  • 24
  • 61
Loading
added 1 character in body
Source Link
Dominic van Essen
  • 37.2k
  • 2
  • 24
  • 61
Loading
added 6 characters in body
Source Link
Dominic van Essen
  • 37.2k
  • 2
  • 24
  • 61
Loading
(several one-after-the-other edits after re-reading the colour restrictions...)
Source Link
Dominic van Essen
  • 37.2k
  • 2
  • 24
  • 61
Loading
added 6 characters in body
Source Link
Dominic van Essen
  • 37.2k
  • 2
  • 24
  • 61
Loading
Source Link
Dominic van Essen
  • 37.2k
  • 2
  • 24
  • 61
Loading