Skip to content

Instantly share code, notes, and snippets.

@kasajian
Created October 5, 2017 20:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kasajian/1dc647f08177b8c74fd8898bda0d8a60 to your computer and use it in GitHub Desktop.
Save kasajian/1dc647f08177b8c74fd8898bda0d8a60 to your computer and use it in GitHub Desktop.
ASCII image of the Mandelbrot set
main (n)
{
float r, i, R, I, b;
for (i = -1; i < 1; i += .06, puts (""))
for (r = -2; I = i, (R = r) < 1; r += .03, putchar (n + 31))
for (n = 0; b = I * I, 26 > n++ && R * R + b < 4;
I = 2 * R * I + i, R = R * R - b + r);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment