Generate a mandelbrot fractal Your task is to draw the mandelbrot set in ascii. It should look something like


The complex number c lies in the mandelbrot set, when the sequence z(n+1) = z(n)^2 + c, z(0) = 0 remains bounded.
For the purpose of this challenge you can consider the sequence bounded for c if |z(32)| &lt; 2.

Plot the mandelbrot set on the complex plane from (-2 - i) to (1 + i), and a minimum resolution of 40x30, using ascii characters in your favourite language, using as few characters as possible.
C, 988 chars
Here's mine, which does an ASCII mandelbrot, written as an ASCII mandelbrot, in C.
Oh.. and it also has interactive zoom functionality. (press the keypad numbers 1-9 to zoom in on the respective area)
int main(int argc, char* argv[]){ unsigned
char c='r';double x1,y,y1,t=0,q=78,r=22,x,
x2,y2,a,b,v;do{(c=='r')?(y2=-(y1=-1.6),x1=
-2.0f,x2=0.8):(c=='?')? c=0,   printf(&quot;%f\
,%f:%f,%f&quot;,x1,y1,x2,y2):(c     &lt;':'&amp;&amp;c&gt;48)
?x=x1,y=y1,*(c&gt;'3'&amp;&amp;c&lt;':'        ?&amp;y1: &amp;t)
+=(y2-y1)/3,*(c&gt;'6'&amp;&amp;c&lt;            ':'?&amp;y1
:&amp;t)+=(y2-y1)/3, *((c               == '8'
||c+3=='8'||c+3 +3==               '8'?&amp;x1
:&amp;t))+=(x2-x1     )/                3,*((c
=='9'||c+3==                        '9'||c
+6=='9'                          ?&amp;x1: &amp;t)
)+=2*(x2-x1)                        /3,x2=
x1+(x2-x)/3,      y2                 =y1+(
y2-y)/3:(c=0);for(y=                y2;y&gt;=
y1&amp;&amp;c;c=1,y-=(y2-y1)/r,            putchar
('\n')) for(x=x1;x&lt;=x2;            x+=(x2-
x1)/q){a=b=c=0; while  (        ++c&amp;&amp;(a=(t
=a)*a)&lt;4&amp;&amp;(v=b*b)&lt;4)a-=v-x     ,b=y+b*2*t;
putchar(&quot;#@XMW*N&amp;KPBQYKG$R&quot;   &quot;STEEVxHOUV&quot;
&quot;CT()[]%JL={}eou?/\\|Ili+~&lt;&gt;_-^\&quot;!;:`,. &quot;[
c?c&gt;&gt;2:63]);}} while((c=getchar ())!='x');
return 0;/* Mandelbrot - S.Goodwin.2001*/}

Originally posted here http://marquisdegeek.com/rnd_obs.php