Created
October 28, 2019 21:44
-
-
Save mimetaur/060333655b4ee486a2d37d24ed98b3e0 to your computer and use it in GitHub Desktop.
code 1 week 5 sketch 2 solution
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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