xxxxxxxxxx
38
let x = 0;
let y = 0;
let GRID_SIZE = 20;
function setup() {
createCanvas(400, 400);
background(255);
// strokeWeight(0);
}
function draw() {
// if (random(1) > 0.5) {
// strokeWeight(4);
// } else {
// strokeWeight(1);
// }
if (random(1) > 0.5) {
// fill(255);
line(x, y, x+GRID_SIZE,y+GRID_SIZE);
} else {
// fill(0);
line(x, y+GRID_SIZE, x+GRID_SIZE,y);
}
// rect(x, y, GRID_SIZE, GRID_SIZE);
x+=GRID_SIZE;
if (x > width) {
x = 0;
y+=20;
}
if (y > height) {
background(255);
x = 0;
y = 0;
}
}