xxxxxxxxxx
28
var x = 0;
var y = 0;
function setup() {
createCanvas(640, 360);
background(255);
}
function draw() {
if (random(1) > 0.5) {
line(x, y, x+20, y+20);
}
else {
line(x, y+20, x+20, y);
}
x += 20;
if (x > width) {
x = 0;
y += 20;
}
if (y > height) {
background(255);
x = 0;
y = 0;
}
}