xxxxxxxxxx
let x = 0;
let y = 0;
let spacing = 50;
function setup() {
createCanvas(windowWidth, windowHeight);
background(255);
}
function draw() {
stroke(0)
strokeWeight(2)
if (random(1) < 0.5) {
line(x, y, x + spacing, y + spacing)
} else {
line(x, y + spacing, x + spacing, y)
}
x = x + spacing
if (x > width) {
x = 0;
y = y + spacing
}
}