Created
April 27, 2011 16:15
-
-
Save lemieuxster/944568 to your computer and use it in GitHub Desktop.
JavaScript Mandlebrot ASCII Art
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Ported from Java which was ported from Python. I can't recall the original author */ | |
function generateMandlebrot() { | |
var b,e,r,n,d,h,out=""; | |
for(e=1.1;e>-1.2;e-=.1)for(b=-2;b<1;b+=.04,out+=(String.fromCharCode(b>1?10:h))) | |
for(r=n=0,h=127;r*r+n*n<4&&--h>32;d=r,r=r*r-n*n+b,n=2*d*n+e); | |
return out; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment