xxxxxxxxxx
46
let size=90;
let space=100
let rows=10;
let columns=10;
let circles=true;
function setup() {
createCanvas(1080, 1080);
// this will help you position things, but it will be diff for every shape, try the options in here and see what it does: https://p5js.org/reference/#/p5/ellipseMode
ellipseMode(CORNER);
background(220);
for (let x=1; x<rows; x++) {
for (let y=1; y<columns; y++) {
if (circles == true) {
push();
translate(x*space, y*space);
fill(random(255),random(255), random(255));
square(0,0, size);
fill(random(255),random(255), random(255));
circle(0, 0, size);
fill(random(255));
triangle(0,0,90,0,90,90);
pop();
} else {
fill(random(255),random(255), random(255));
push();
translate(x*space, y*space);
// square(0,0, size);
// circle(0, 0, size);
triangle(0,0,90,0,90,90);
pop();
}
}
}
}