var fDesc=new Array(); fDesc[0] = "The Flocking demo allows you to play with the four rules of flocking: separation, alignment, cohesion, and avoidance. Separation means that each member, or boid, of a flock tries to keep a minimum distance from every other boid in the flock. Alignment means that each boid tries to go in the same direction as the rest of the flock.

Main features:

- View a 2D simulation of one flock or multiple flocks
- Run or step through a simulation
- Set the number of flocks (1-10)
- Set the number of boids (members) of each flock (2-100)
- Toggle on/off any flocking rule
- Set the relative strength of the rule on each member of the flock"; function tShowHide(id, show) { var s = document.getElementById("desc"); if ((s.innerHTML.length<=212 || show==1) && show!=2) { s.innerHTML = fDesc[id]; if (document.getElementById('m1')) document.getElementById('m1').style.display='none'; if (document.getElementById('m2')) document.getElementById('m2').style.display='none'; if (document.getElementById('more_txt')) document.getElementById('more_txt').style.display='inline'; } else { s.innerHTML = ''; } }