Skip to content

Instantly share code, notes, and snippets.

@mimetaur
Created October 28, 2019 21:44
Show Gist options
  • Save mimetaur/060333655b4ee486a2d37d24ed98b3e0 to your computer and use it in GitHub Desktop.
Save mimetaur/060333655b4ee486a2d37d24ed98b3e0 to your computer and use it in GitHub Desktop.
code 1 week 5 sketch 2 solution
function setup() {
createCanvas(400, 400);
}
function draw() {
background(255);
drawSquares(9);
}
function drawSquares(num) {
for (let i = 0; i < num; i++) {
let size = 55;
let steps = size + 30;
rect(i * steps, height / 2, size, size);
rectMode(CENTER);
fill(100, 200, 0);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment