Skip to content

Commit

Permalink
add random line
Browse files Browse the repository at this point in the history
  • Loading branch information
sato-makoto committed Dec 2, 2017
1 parent 3fad5a2 commit 2e10934
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions lines/lines.pde
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// 長さ、方向、色のランダムな太い半透明の棒
// 200本で停止
void setup() {
size(800,600);
frameRate(10);
background(0);
}

void lines() {
int w = 30;
int c1 = int(random(256));
int c2 = int(random(256));
int c3 = int(random(256));
int a = int(random(800));
int b = int(random(800));
int c = int(random(800));
int d = int(random(800));
stroke(c1,c2,c3,200);
strokeWeight(w);
line(a,b,c,d);
}
int l = 0;
void draw() {
if (l > 200) {
exit();
}
lines();
l+=1;
println(l);
}

0 comments on commit 2e10934

Please sign in to comment.