File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -199,7 +199,7 @@ Above `setup()`:
199199In ` draw() ` :
200200
201201- After the code that draws the finish line, declare a new local variable ` x ` to position all the body segments: ` let x = circX; `
202- - Add a * for loop* using: ` for (let i = 0; i < length ; i += 1) { } `
202+ - Add a * for loop* using: ` for (let i = 0; i < segments ; i += 1) { } `
203203 - A * for loop* will repeat the code we write inside the curly brackets multiple times.
204204 - Move the lines of code that draw the ` circle() ` into the curly brackets of the * for loop* .
205205- After the for loop, add: ` circX += spacing `
@@ -936,7 +936,7 @@ function moveCaterpillars() {
936936 for (let i = 0 ; i < numCaterpillars; i += 1 ) {
937937 // Give each caterpillar a
938938 // random speed.
939- move = random (5 , 30 );
939+ let move = random (5 , 30 );
940940 caterpillarEnds[i] += move;
941941 }
942942}
@@ -1001,7 +1001,7 @@ function moveCaterpillars() {
10011001 for (let i = 0; i < numCaterpillars; i += 1) {
10021002 //Give each caterpillar a
10031003 //random speed.
1004- move = random(5, 30);
1004+ let move = random(5, 30);
10051005
10061006 // Update caterpillars' x-coordinates
10071007 caterpillarEnds[i] += move;
You can’t perform that action at this time.
0 commit comments