///a simple example of an if statement and a for loop(iteration)
// changing the initial value of x triggers different conditions
//although the 3rd condition is triggered by pressing the mouse if the first 2 conditions are not true
//also see learning examples>Input>click for a good if statement example

int x = 2;

void setup()
{
size(400,400);
}

void draw()
{
if (x == 2) {
stroke(0);
line(30, 100, 200, 200);
}
else if (x == 3) {
//do nothing here
}
else if (mousePressed) {
fill(200, 0, 0);
rect(mouseX, mouseY, 49, 200);

} else { //a loop that iterates 8 times(5) until 40 is reached
for (int i=0; i < 40; i+=5){
stroke(0);
line(i, 100, 200, 200);
//line(i, 100, mouseX, mouseY);
}
}
}