Skip to content

Instantly share code, notes, and snippets.

@mimetaur
Last active October 28, 2019 21:36
Show Gist options
  • Save mimetaur/f12c49486df26a8bb3d9d48946c4ee4d to your computer and use it in GitHub Desktop.
Save mimetaur/f12c49486df26a8bb3d9d48946c4ee4d to your computer and use it in GitHub Desktop.
Code 1 Week 5 Sketch #4 solution
function setup() {
createCanvas(400, 400);
background(220);
noStroke();
fill(80);
}
function draw() {
drawSpiral();
}
function drawSpiral() {
for (i = 0; i < 90; i++) { // loop
rectMode(CENTER);
angleMode(DEGREES);
translate(width / 2, height / 2);
applyMatrix();
rotate(10 * i);
scale(0.5);
translate(200, 200);
rect(i, i, 10, 10);
resetMatrix();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment