I was looking at a fractal tree example, and came opon this, and didnt know what to make of it, so here it is.
w = (level == 1) ? 9 : max_level-level+1;
If you want it in context here it is
function growtree(level, o_x, o_y, angle, len) {
rad = Math.PI/180*angle;
var e_x = o_x+len*Math.cos(rad);
var e_y = o_y-len*Math.sin(rad);
w = (level == 1) ? 9 : max_level-level+1;
this.lineStyle(w,0xabcdef, 100);
moveTo(o_x, o_y);
lineTo(e_x, e_y);
if (level<max_level) {
for (var i = 1; i<=max_shoot; i++) {
growtree(level+1, e_x, e_y, angle+max_angle*(Math.random()*2-1), len*short_fraction);
}
}
}
max_angle = 60;
max_level = 6;
max_shoot = 4;
short_fraction = .7;
base_angle = 6;
_root.onMouseDown = function() {
this.clear();
growtree(1, Stage.width/2, Stage.height, 90+base_angle*(Math.random()*2-1), 115);
};
growtree(1, Stage.width/2, Stage.height, 90+base_angle*(Math.random()*2-1), 115);
P.S. Does kirupa have 25 line competitions like the bit-101 forums? or add a line change a line threads.Just wondering.