input:
//variable scope变量范围
float endX = 0;
void setup(){
size(400,300);
}
void draw(){
background(0);
strokeWeight(2);
stroke(255);
int x = 0;
while (x < endX){ //x < width/2;x < 300;x < mouseX
line(x,0,x,height);
x = x + 20;
}
endX = endX + 1; //循环输出线条的效果
}
output: