# Wierd line of code

**URL:** <https://forum.kirupa.com/t/wierd-line-of-code/104052>\
**Category:** Uncategorized\
**Created:** [March 11, 2004, 10:54pm UTC](https://forum.kirupa.com/t/wierd-line-of-code/104052 "2004-03-11T22:54:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![session9](https://avatars.discourse-cdn.com/v4/letter/s/8baadc/32.png) [@session9](https://forum.kirupa.com/u/session9)\
**Post date:** [March 11, 2004, 10:54pm UTC](https://forum.kirupa.com/t/wierd-line-of-code/104052/1 "2004-03-11T22:54:37Z")

</div>

I was looking at a fractal tree example, and came opon this, and didnt know what to make of it, so here it is.

```auto

w = (level == 1) ? 9 : max_level-level+1; 

```

If you want it in context here it is

```auto

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.
