xxxxxxxxxx
32
let x = 0;
let y = 0;
let gap = 10;
function setup() {
createCanvas(400, 400);
background(0);
}
function draw() {
stroke(255);
if (random() > 0.5) {
stroke(200,random(), random());
// this is a \
line(x, y, x + gap, y + gap);
circle(x, y, gap);
} else {
stroke(255)
// this is a /
line(x + gap, y, x, y + gap);
}
x += gap;
if(x >= 400){
x = 0;
y += gap;
}
}