# Unit 6 Lesson 8 Loops Make AP Writing Practice

**URL:** <https://forum.code.org/t/unit-6-lesson-8-loops-make-ap-writing-practice/40314>\
**Category:** Unit and Lesson Discussion\
**Created:** [January 17, 2025, 8:23pm UTC](https://forum.code.org/t/unit-6-lesson-8-loops-make-ap-writing-practice/40314 "2025-01-17T20:23:01Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jreynolds](https://avatars.discourse-cdn.com/v4/letter/j/58956e/32.png) [@jreynolds](https://forum.code.org/u/jreynolds)\
**Post date:** [January 17, 2025, 8:23pm UTC](https://forum.code.org/t/unit-6-lesson-8-loops-make-ap-writing-practice/40314/1 "2025-01-17T20:23:01Z")

</div>

Unit 6, Lesson 8 has a new writing prompt added to the activity guide help students prepare for the AP Exam. It asks the students to write how their iteration statement is used to traverse a list. The program only has one list and it is just the different icon images. This list is only used with a random number generator. It is not used with a loop anywhere. I looked at the solution file and it also doesn’t use a loop to iterate over a list. The question probably needs to be rewritten!

---

<div class="post-metadata">

**Author:** ![sgaraas](https://avatars.discourse-cdn.com/v4/letter/s/97f17d/32.png) [@sgaraas](https://forum.code.org/u/sgaraas)\
**Post date:** [January 17, 2025, 8:57pm UTC](https://forum.code.org/t/unit-6-lesson-8-loops-make-ap-writing-practice/40314/2 "2025-01-17T20:57:34Z")

</div>

In that app there are 20 images on the screen. The purpose of the loop is to loop through all the ids to modify them all within the loop instead of having 20 lines of code modifying each one individually.

Here is the code for the Shapes Button:

onEvent(“shapesButton”, “click”, function( ) {  
var selectedIcon = iconsList[(randomNumber(0, iconsList.length - 1))];  
for (var i = 0; i \< 20; i++) {  
setProperty(“icon” + i, “image”, selectedIcon);  
}  
});

---

<div class="post-metadata">

**Author:** ![jreynolds](https://avatars.discourse-cdn.com/v4/letter/j/58956e/32.png) [@jreynolds](https://forum.code.org/u/jreynolds)\
**Post date:** [January 17, 2025, 9:09pm UTC](https://forum.code.org/t/unit-6-lesson-8-loops-make-ap-writing-practice/40314/3 "2025-01-17T21:09:38Z")

</div>

Hi there - I am familiar with the code. The problem is that the writing prompt refers to “iterating” through a list. The images are not stored in a list. If you have not used the new Activity Guide, you would need to take a look to see what I am referring to. I am happy to have new writing practice, but the prompt is not appropriate for this lesson. Just wanted to warn other teachers who may also notice the error. Thanks

---

<div class="post-metadata">

**Author:** ![sgaraas](https://avatars.discourse-cdn.com/v4/letter/s/97f17d/32.png) [@sgaraas](https://forum.code.org/u/sgaraas)\
**Post date:** [January 17, 2025, 9:14pm UTC](https://forum.code.org/t/unit-6-lesson-8-loops-make-ap-writing-practice/40314/4 "2025-01-17T21:14:24Z")

</div>

Sorry, I guess I don’t see the new Activity Guide for students. I do see the question that you are referring to on the Teacher Exemplar copy, but not the student version.

---

<div class="post-metadata">

**Author:** ![jreynolds](https://avatars.discourse-cdn.com/v4/letter/j/58956e/32.png) [@jreynolds](https://forum.code.org/u/jreynolds)\
**Post date:** [January 17, 2025, 9:41pm UTC](https://forum.code.org/t/unit-6-lesson-8-loops-make-ap-writing-practice/40314/5 "2025-01-17T21:41:00Z")

</div>

It’s probably just my mistake then. I’ll double check that I have the newest version of the student activity guide!

---

<div class="post-metadata">

**Author:** ![mkmietowicz](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/mkmietowicz/32/6322_2.png) [@mkmietowicz](https://forum.code.org/u/mkmietowicz)\
**Post date:** [January 21, 2025, 1:22am UTC](https://forum.code.org/t/unit-6-lesson-8-loops-make-ap-writing-practice/40314/7 "2025-01-21T01:22:36Z")

</div>

@jreynolds I just checked the lesson plan. You are correct that the exemplar and student handout do not match. Thank you for catching this! I’ll update the curriculum team so they can fix it.

–Michael K.

---

<div class="post-metadata">

**Author:** ![paula.drumm](https://avatars.discourse-cdn.com/v4/letter/p/a8b319/32.png) [@paula.drumm](https://forum.code.org/u/paula.drumm)\
**Post date:** [February 7, 2025, 3:21am UTC](https://forum.code.org/t/unit-6-lesson-8-loops-make-ap-writing-practice/40314/8 "2025-02-07T03:21:48Z")

</div>

Did anyone change this prompt to make it fit the code better?

---

<div class="post-metadata">

**Author:** ![jmcdonald](https://avatars.discourse-cdn.com/v4/letter/j/ebca7d/32.png) [@jmcdonald](https://forum.code.org/u/jmcdonald)\
**Post date:** [February 13, 2025, 11:23am UTC](https://forum.code.org/t/unit-6-lesson-8-loops-make-ap-writing-practice/40314/9 "2025-02-13T11:23:15Z")

</div>

Hi all,  
I have a very smart student. 1500+ SAT. Better coder than me. He refuses to do the written responses in paragraph format and will not use sentence starters.  
Do you think he would get awarded points for this written response for Unit 6 Lesson ?  
This question is based on the project you submitted.

Consider an iteration statement in your program.

• Describe how this iteration statement works.

• Explain how the loop ensures that each icon (e.g., “icon0”, “icon1”, …, “icon19”) gets updated.

The loop which sets the colours of each icon is as follows:

1. Dimensionalizes i and sets it to 0.

2. If i is less than 20,

3. Calculate the random size.

4. Set the position of “icon” + String(i) to a random value. It can go off the screen by size pixels.

5. Set the size to the computed size.

6. Increment i.

7. Go back to Step 2.

The literal “icon” + String(i) gets the ith icon.
