HashSet drops = new HashSet();
void setup(){
  
 size (400,400);
  strokeWeight(2);
  stroke(200,0,0);
}
void draw(){
   Iterator i = drops.iterator();
  while(i.hasNext()){
     drop d =(drop) i.next();
     d.move();
  } 
  
}
float x,y;
void mousePressed(){
    x = mouseX;
    y = mouseY;
    adddrop();
}
void mouseDragged(){
   line(mouseX,mouseY,x,y); 
    x = mouseX;
    y = mouseY;
adddrop();
}


void adddrop(){
   if(random(10)< 1){
      drops.add(new drop(x,y));
   } 
}


class drop{
   float x,y;
  drop(float px,float py){
     x = px; y = py;
  } 
  void move(){
    if(random(20)<1.0){
        line(x,y,x,y+1);
        y+=1;
        
    }
  }
  
}