Skip to content

Instantly share code, notes, and snippets.

@slambert
Created September 27, 2016 21:08
Show Gist options
  • Select an option

  • Save slambert/4cd240a9b46bade48127446e526b9993 to your computer and use it in GitHub Desktop.

Select an option

Save slambert/4cd240a9b46bade48127446e526b9993 to your computer and use it in GitHub Desktop.
Talking about how *where* you place random() changes the result
void setup(){
size(300,300);
smooth();
}
void draw(){
background(255);
stroke(0);
for (int i = 0; i < height; ++i) {
float randomwidth = random(0,width);
line(0,i,randomwidth, i);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment