// The number of squares to draw is chosen by the user by pushing
// the number keys between 0 and 9.
void setup(){
  size(1000,200);
}

int numSquares;

void draw(){
  background(0);
  if(keyPressed) {
    if((key >= '0') && (key <= '9')){
      numSquares = key - '0';
    }
  }
  // write the function which is called here
  drawSquares(numSquares);
}