I am trying to get the program to draw a random number of these 2 concentric ellipses all over the canvas, while keeping its concentric detail and it must stay within the nested for loop. I've tried so many things but each time the concentric detail turns into a scattered mess. Any advice?
I don't believe the "total * 10" "total * 20" etc do not need to be changed... the only part of the ellipses that need to be randomized are the 200 values right? That's my idea on that anyways
Code
noStroke();
var flower = function(x,y) {
for(var total = 5; total > 0; total--){
fill(random(0,255),random(0,255), random(0,255));
for(var i = 0; i < random(1,20); i++) {
ellipse(200, 200, total * 10, total * 20);
ellipse(200, 200, total * 20, total * 10);
}
}
};
flower();
I did a similar assignment with a while loop and I've been kind of trying to base this for loop assignment off this since they're pretty similar.
Code
var i = 0;
var circle = function(x,y) {
while (i< random (1, 20)){
stroke(random(0,255),random(0,255), random(0,255));
strokeWeight(random(0,50));
point(random(x,y), random(x,y));
i++;
}
};
draw = function() {
circle(0,400);
};
This post was edited by Shakti on Oct 25 2016 08:25pm