Skip to content

Instantly share code, notes, and snippets.

@lizzybrooks
Forked from nataliefreed/loops example.js
Created July 17, 2017 17:59
Show Gist options
  • Save lizzybrooks/9a467c1c9a171cef6db077a129a01640 to your computer and use it in GitHub Desktop.
Save lizzybrooks/9a467c1c9a171cef6db077a129a01640 to your computer and use it in GitHub Desktop.
function setup() {
createCanvas(800, 800);
for(var i=0;i<10;i++) {
if(i % 3 == 0) {
arrow(50, 50, 10, color(255, 0, 100));
}
else {
arrow(50, 50, 10, color(150, 0, 255));
}
translate(50, 0);
}
var total = 0;
while(total < 100) {
arrow(50, 50, 10, color(100, 200, 255));
translate(20, 20);
total = total+10;
}
}
function draw() {
}
function arrow(x, y, w, color) {
strokeWeight(3);
stroke(color);
line(x-3.*w,y, x+w, y);
line(x+w,y, x, y-w*0.5);
line(x+w,y, x, y+w*0.5);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment