🧠Concept
Pick the right answer.
insert [red] at (1) of [votes] do?change [red] by (1) on click. How does the count grow?add and insert at (1)?👀Code Reading
Look at the blocks. Predict what happens.
votes is empty. You run this. What is item 1 of votes?add [red] to [votes v] add [blue] to [votes v] insert [green] at (1) of [votes v]
counts holds [4, 2, 5]. What does top hold after this runs?set [top v] to (item (1) of [counts v])
set [i v] to (1)
repeat (length of [counts v])
if <(item (i) of [counts v]) > (top)> then
set [top v] to (item (i) of [counts v])
end
change [i v] by (1)
endvotes holds [red, blue]. What number does this show?insert [green] at (1) of [votes v] set [total v] to (length of [votes v])
🐛Find the Bug
Something is broken. Pick the fix.
This should put the newest vote at the front of votes, but it goes to the end. What is the fix?
when this sprite clicked change [green v] by (1) add [green] to [votes v]
🛠️Build It
Pick a level. Build it. Check the boxes.
Two buttons count clicks.
More
Make two color buttons that count clicks. On flag click, set both counts to 0. Each button changes its own count by 1. Show both monitors.
Done when
Flag resets both counts to 0. Each button adds 1 to its own count. Both monitors are visible.
Each vote adds to a list.
More
Add a list votes. Each button also adds its color word to the list. Show the list monitor and a total count using length of [votes].
Done when
Each click changes a count and adds the color to the list. The total equals the list length and updates on every click.
Find the biggest count and say it.
More
Add a comparer on the space key. Copy the three counts into a counts list. Then use repeat (length of [counts]) with item (i) of [counts] to keep the biggest count in top, like the lesson. Make the sprite say top. Also insert each new vote at the front of votes with insert at (1).
Done when
Space copies the three counts into counts, and the loop keeps the biggest in top and says it. New votes are inserted at the front so the newest is item 1.
Review the student's project, then check each thing they did.
Project Evaluation
0 of 4 ticked
💬Talk About It
Present your project to your teacher or a classmate.
- 1️⃣Show your project.
- 2️⃣Point to a count monitor, the list, and the
insertblock. - 3️⃣Click a button, then say one word: which color is the most.
Watch the student present, then check each thing they did.
Presentation Checklist
0 of 4 ticked
📤Submit
Send your results to your teacher and parent.
0 of 0 answered