Coding Project 17 — Repeating Without Rebuilding
KIPR · Botball Explorer
Activity Sections

Introductory · EV3 Coding Project 17

Repeating Without Rebuilding

The last loop — and the last thirty-eight points on the field.

Project
Coding Project 17
Strand
Coding
Phase
Clean It Up
Time
One class period
What You Are Doing
Learning the loop that counts, then using it to collect every bonus that just means “now do that again.”
Mission Anchor
Mission 7 · 11 · 16 · 17 bonuses — 38 points
What You Need
Before You Start
Project 16 — your blocks should live in your Toolbox by now, and this project starts as a duplicate of it.
Before you start: type your PIN in the box at the top of the page. Your teacher gave you this number. When you finish, press Download to save a local copy of your answers. This does not turn in your work automatically; give the downloaded file to your teacher.

Try It — Thirty Small Hops

Back in Project 9 you moved the arm in three big jumps and were asked what it would take to move it in thirty small ones. Here is the answer you were promised.

Read it with a partner before you run it, and answer these from the blocks alone.

QuestionMy answer
Where does climbed start?
What makes the loop stop?
How much does it change each trip round?
So how many times does the loop run?

Now run it with your own arm numbers and watch.

How is this different from a single run A ↻ for (arm up) degrees block on its own?

A Smooth Arm Is a Careful Arm

An arm that snaps to a position throws whatever it is holding. An arm that creeps there sets things down gently — which matters for every final-position mission you have.

Where the counting lives

Look at that loop again. The three things that control the counting are in three different places: the start is in the set block above the jaws, the stopping point is in the hexagon, and the step is buried inside.

If a teammate asked you “how many times does that run?”, how long would it take to work out — and where would your eyes have to jump?

Learn It — The Loop That Counts For You

When what you really mean is “do this N times,” there is a block that says exactly that — and the count sits right on its face where anyone can read it:

No variable to set, no hexagon to aim, no step to hide. The loop does the counting for you. You have already used it once — the repeat 4 in your drive square, back in Project 12. Now you know what family it belongs to.

Three loops, three jobs

Code / partWhat it means
repeat NYou know how many. Two poms, four sides, three cubes. The count is the point.
repeat until / wait untilYou are waiting for the world — a press, a line, an angle. You have no idea how many trips it will take, and you do not care.
a counter in the jawsThe number itself is doing work — like climbed creeping upward in the smoother. The variable is not just counting trips; every value it passes through matters.

The Bonus Pattern

Go back and read the missions you have already scored. Over and over, the bonus is just the base again: a second pom, a second cone, one cube higher.

You built the base as a block. The bonus is that block in a repeat. That is the whole project.

Repeats hold anything

Jaws are jaws. A repeat can hold your My Blocks, an if-then-else, even another repeat. The square is a repeat holding two of your blocks; a two-tier pom run is a repeat holding fetch-and-drop; the smoother is a repeat holding a change and a move. Same block, every time.

Do It — Do It Again — Automatically

Step 1 — Build the smoother

Duplicate your Toolbox for this project. Build the Try It smoother with your own numbers, then wrap it in a My Block called arm up gently, and make arm down gently to match — same loop, counting the other way.

What did you change to make it count down?

Step 2 — The square, one last time

Rebuild the square as repeat 4 { drive forward 24 · turn right 90 } — three visible blocks in the main stack.

A teammate reads it. How long does it take them to answer “how many sides?” — and where do their eyes go?

Step 3 — Mission 11 Bonus — two orange poms7 pts

Mission 11

Hazard Disposal

Watch Mission 11 video

Base Mission

7 points Final judged

One Orange Pom is a basket.

Bonus Mission

7 points Final judged

Two or more Orange Poms are the same basket.

Scores

  • One Orange Pom is a basket.
  • One Orange Pom partially extends into the interior space of a basket.
  • Two or more Orange Poms are the same basket.

Does Not Score

  • An Orange Pom is touching only the outside of a basket.
  • An Orange Pom is resting above a basket without extending into it.
  • One Orange Pom is in Basket A and one is in Basket B — does not satisfy Bonus.

Start here — it is the simplest “do it twice” on the field, and you already own the block.

Two Ways, Both Fine

Call your block twice, or wrap one call in a repeat 2. Try both and see which reads better to you.

The loop wins the moment the number might change — and at a tournament it always might.

The second pom is somewhere different, so your block needs an input or a short drive between trips. Same problem you solved for Mission 15 in Project 12.

Step 4 — Missions 16 and 17 Bonuses — stack them higher22 pts

Watch Mission 16 video

Base Mission

9 points Final judged

At least one cube originating from the Spilled Cube area is the Large Green Cube.

Bonus Mission

11 points Final judged

Two or more cubes originating from the Spilled Cube area are the Large Green Cube.

Scores

  • One spilled cube is the Large Green Cube.
  • One spilled cube is the Large Green Cube while supported by a robot.
  • One spilled cube another spilled cube that is the Large Green Cube.
  • Multiple spilled cubes the Large Green Cube.

Does Not Score

  • A spilled cube touching only the side of the Large Green Cube.
  • A spilled cube not originating from the Spilled Cube area.
  • Only one spilled cube the Large Green Cube for the Bonus Mission.

⚠ Final Position --- Both Have to Survive

Delivering the second cube is where the first one gets knocked off. Approach the same way each trip, and back straight away rather than turning while you are still close.

Did the second delivery ever knock the first one off? What fixed it?

Step 5 — Mission 7 Bonus — a second enclosure9 pts

Watch Mission 7 video

Base Mission

11 points Final judged

One Blue Pom and one Orange Pom are the same PVC enclosure.

Bonus Mission

9 points Final judged

A second PVC enclosure contains at least one Blue Pom and at least one Orange Pom, each the enclosure. The Base and Bonus must use different enclosures.

Scores

  • One Blue Pom and one Orange Pom are the same PVC enclosure.
  • Multiple Blue Poms and one Orange Pom are the same PVC enclosure.
  • Two different enclosures each containing at least one Blue and one Orange Pom.

Does Not Score

  • A Blue Pom in one enclosure and an Orange Pom in a different enclosure.
  • Only one pom type in any enclosure.
  • The same enclosure used to satisfy both Base and Bonus Missions.

This is the same delivery as the base, aimed somewhere else — which is exactly the case for a block with an input called twice, or a repeat over two destinations.

Step 6 — Put the loops in your Toolbox

Anything you wrapped in a loop that worked — deliver poms (how many), arm up gently — belongs in the master Toolbox. Add it there first, and note it in your team instructions.

Step 7 — Run it five times

RunM11M16M17M7Points
1
2
3
4
5

Score It — Checkpoint

My score

Mission partScored?Points
Mission 11 — Bonus (two orange poms, same basket)7
Mission 16 — Bonus (two spilled cubes on the green)11
Mission 17 — Bonus (two unstraight cubes on the brown)11
Mission 7 — Bonus (a second enclosure)9
My total this project38

Which loop?

Pick the right tool: repeat N, repeat until / wait until, or a counter in the jaws.

The robot should…Loop
Fetch exactly three cubes
Drive until it sees the black line
Sweep the arm through every position from down to up, slowly
Beep five times

How many times?

From the blocks alone, how many trips through the jaws?

The loopTrips
repeat 6 { beep }
set n to 0 · repeat until (n > 3) { change n by 1 · beep }
set n to 10 · repeat until (n > 3) { change n by 1 · beep }

That last one is legal and runs. What does it actually do, and why is it a trap?

Can you do it again?

Every point on the field

Add up what you scored across the whole strand. The right-hand column is what was available.

ProjectI scoredAvailable
4 — Out and Back4
6 — Bulldoze Run16
7 — Your Robot’s Arm7
8 — Arm and Claw Together37
9 — Names for Your Numbers20
10 — Feeling for Things13
11 — Counting Wheel Ticks40
12 — Teaching Your Robot New Moves18
13 — Deciding What to Do22
14 — Seeing Light and Dark35
15 — Following the Line51
17 — Repeating Without Retyping38
Total301

301 Is the Whole Game

Add up every base, bonus, and advanced bonus across all eighteen Stack Attack missions and the number is 301.

There is nothing on that field you have not been taught how to reach.

Think about it

You have built four kinds of loop question now — a switch, a wheel count, a brightness, and a plain count. Which was hardest to get right, and why that one?

In Project 1 you ran a program somebody else wrote and did not understand a line of it. Go back and read that program now. What does it say to you?

Your robot does exactly what it is told, every time, and has no idea what any of it means. After seventeen projects, does it seem intelligent to you? Say what makes you answer that way.

That Is the Coding Strand

Seventeen projects ago your robot could not be switched on. It now drives measured distances, turns to an angle, grabs and stacks and places, feels for walls, counts its own wheels, reads light and dark, follows a line, checks its own work, and decides what to do when something goes wrong.

All of it built from about a dozen commands and four ideas: do this, do it if, do it while, do it again.

Take your Toolbox with you. Next season the field will be different and most of what is in that project will still work.

Download saves a local copy of your answers. It does not turn in your work automatically; give the downloaded file to your teacher.

KIPR · Botball Explorer — Introductory Projects · © KISS Institute for Practical Robotics 1997–2026