previous

page 11

next
and what about this?

Click here to reveal my answer.

function test() {
for (var i=0;i<10;i++) {
var diameter=360;
for (var j=0;j<5;j++) {
circle(diameter);
diameter=diameter-20;
}
rt(36);
}
}
Generalising

Generalise your answer by creating circles(n,dd) where n is the number of circles to draw and dd is how much to decrease the diameter by each time in each of the 10 positions

So circles(5,20) should produce the same picture as above.

Click here to reveal my answer.

function circles(n,dd) {
for (var i=0;i<10;i++) {
var diameter=360;
for (var j=0;j<n;j++) {
circle(diameter);
diameter=diameter-dd;
}
rt(36);
}
}
previous
next