xxxxxxxxxx
28
function setup() {
createCanvas(400, 400);
stroke(255, 0, 0);
background(220);
for (let x = 0; x < width/2; x+=1) {
for (let y = 0; y < height/2; y +=1) {
// simple logic to change pixel color based on
// x and y position
if (x % 2 === 0) {
stroke(0,0,255);
} else {
stroke(255, 0, 0);
}
point(x,y);
}
}
}
function draw() {
}