IchigoLatte JS による マンデルブロ

// mandelbrot
function cplx(r, i){
this.r = r;
this.i = i;
this.mul = function(t){
var r = (this.r * t.r) - (this.i * t.i);
var i = (this.r * t.i) + (this.i * t.r);
this.r = r / 10;
this.i = i / 10;
return this;
};
this.add = function(t){
this.r = this.r + t.r;
this.i = this.i + t.i;
return this;
};
}
var t0 = tick();
lc(0, 0);
var y = 0;
while(y < 24-1){
var x = 0;
while(x < 32){
var c = new cplx(x-16-8, y-12+1);
var n = new cplx(0, 0);
var i = 0;
var a = (n.r*n.r) + (n.i*n.i);
while( (i<32) * (a<46340) ){
n.mul(n).add(c);
i = i + 1;
a = (n.r*n.r) + (n.i*n.i);
}
var d = 0;
while(a = a>>4) d=d+1;
log( chr(mem((1+" -+*@#")+d)) );
x = x + 1;
}
y = y + 1;
}
log(tick()-t0, "(ms) ");

いわゆるフラクタル図形というものですね。単純な数式からこんなにキレイな図形が出てくるというのがまさに神秘。収束速度によって表示する文字を変えていて芸が細かい!