Home YouTube itch.io Webpage Source


Miscellaneous

This is just where I will put random things that I think are interesting but don't really have a good place anywhere else on this website.


Mandelbrot Set Program in 190 characters

#define l(v)for(float v=-2;v<=2;v+=.1f)
int main(){l(i){l(r){float a=0,b=0;int v=16;while(v>0){float t=a*a-b*b+r;b=2*a*b+i;a=t;if(t*t+b*b>4)v=0;--v;}v?printf(".."):printf("##");}puts("");}}


I was bored one day and decided to waste some time trying to code golf a C program that could output the Mandelbrot Set to stdout. As far as I've tested, this compiles under gcc 11.4.0 on Ubuntu.

Copy and paste the code and try it out yourself! :D