Continuous Random Line

You mean like that:

?

//ArrayList is just an Array but you can add and remove points
//<Class> says what type of arrayList you want to have
//And PVector is a class of processing (in short a class with 2 floats x and y)
ArrayList<PVector> points;

void setup() {
  size(800, 800);//Set the window size
  points = new ArrayList<PVector>();
  //We have to add same Points to the arrayList.
  int count = 10;
  for (int i = 0; i < count; i++) {
    //Creates a Vector with an, x and y value (float)
    PVector p = new PVector(random(width), random(height));
    //adds the created PVector
    points.add(p);
  }
  PVector p = points.get(0); // get the first point
  points.add(p);//add the same point add the add
  noLoop();
  selectOutput("Select output: ", "outputSelected");
}
void outputSelected(File f) {
  if (f == null) return;
  saveFrame(f.getAbsolutePath() + ".png");
}
void draw() {
  background(0);
  //There are two types of for loops to show each point
  //the first 
  //PVector.size() is the same of array.length()
  noFill();
  stroke(255);
  strokeWeight(2);
  //shows the line
  beginShape();
  for (int i = 0; i < points.size(); i++) {
    //.get(i) is the same of array[i]
    PVector currentPoint = points.get(i);
    //add a point in the shape
    vertex(currentPoint.x, currentPoint.y);
  }
  endShape();
  //the second
  //for( the class then a space then the name of the variable : and the array or the arraylist
  //shows the points
  for (PVector currentPoint : points) {
    stroke(255);
    strokeWeight(10);
    point(currentPoint.x, currentPoint.y);
  }
}