submission by jtoy
function Neuron(){
  this.x = random(width)
  this.y = random(height)
  this.size = random(1)
  this.c = color(0,random(100,255),0)
  //this.size = s
  this.t = random(100)
  this.length = 10
  this.tailunits=20
  this.spin= 3
  this.ys = []
  this.xs = []
  this.fire = random(0)
  this.fire_threshold = 0.95
  for(var i =0;i<this.length;i++){
    this.xs[i] = 0
    this.ys[i] = 0
  }
  
  this.segment = function(x, y, a,i) {
  
  if(this.fire > this.fire_threshold){  
    stroke(255,255,0)
  }else{
    stroke(this.c)
  }
  strokeWeight(this.tailunits-i)
  push();
  translate(x, y);
  rotate(a);
  line(0, 0, this.length*this.size, 0);
  pop();
  }
  this.update = function(){
    this.x += noise(this.t)*2-1
    this.y += noise(this.t+1)*2-1
    this.t += 0.01
    this.fire = random(1)

  }
  this.dragSegment = function(i,xin,yin){
    
    dx = xin - this.xs[i];
    dy = yin - this.ys[i];
    angle = atan2(dy, dx);  
    this.xs[i] = xin - cos(angle) * this.length*this.size;
    this.ys[i] = yin - sin(angle) * this.length*this.size;
    
    this.segment(this.xs[i], this.ys[i], angle,i);
  }
  
  this.show = function(){
    l = 80
    
    push()
    translate(this.x,this.y)

    noStroke()
    
    fill(0,0,255)
    
    for(var i=0;i<4;i++){
      push()
      rotate(radians(360/this.spin*i))
      beginShape()
      vertex(-l*.8*this.size,0)
      bezierVertex(l*.8*this.size/2,l*.8*this.size/4,l*.8*this.size*1*.8*.5,0,l*.8*this.size,0)
      endShape()
      pop()
    }
    fill(this.c)
    ellipse(0,0,l*.7*this.size,l*.7*this.size)
    if(this.fire > this.fire_threshold){
      fill(255,255,0)
      ellipse(0,0,l*.7*this.size*.7,l*.7*this.size*.7)
    }
    
    pop()
    stroke(this.c)
    
    this.dragSegment(0, this.x,this.y);
    for(i=0; i<this.tailunits; i++) {
      this.dragSegment(i+1, this.xs[i], this.ys[i]);
    }


  }
  pop()
 // }
  
}
function setup(){
  var myCanvas = createCanvas(windowWidth,windowHeight); //you must keep this line unmodified
  neurons = []
  background(0)
  for(var i=1;i<200;i++){
    //neurons.push(new Neuron(1/i))
    neurons.push(new Neuron)

  }

}

function draw(){
    background(0,3)
    for(var ii=0;ii<neurons.length;ii++){
    neurons[ii].update()
    neurons[ii].show()
  }
  
}