I've tried a Goto 10 exercise on Processing and have no idea where is my mistake. The intent was to make a Goto 10 like scenario but there's something I'm missing. I believe the loop may be off.
//line size
int a = 15;
void setup(){
background(255);
size(500,500);
noLoop();
strokeWeight(2);
}
void draw(){
// Y
for(int lineY = 0; lineY < height/a; lineY++){
// X
for(int lineX = 0; lineX < width/a; lineX++){
float randomN = random(1);
pushMatrix();
if (randomN >= 0.5){
rotate(-90);
}
else {
rotate(-45);
}
line(0,0,a,0);
popMatrix();
translate(a, 0);
}
translate((-width), a);
}
}