Base Mission
7 points Live judgedCreate one stack consisting of a Green Cube a Yellow Cube, or a Yellow Cube a Green Cube.
Introductory · EV3 Coding Project 13
Until now your robot has followed orders. Today it starts choosing.
Student PIN:
Load your Project 12 program — the blue pom run. Before you press start, move the first pom about four inches to one side. Now run it and watch closely.
| Question | What happened |
|---|---|
| Did the claw close on anything? | |
| What did the robot do next? | |
| Did it drive to the basket anyway? | |
| Did it open the claw at the end? |
⚠ Your Robot Has No Idea Anything Went Wrong
It drove to a spot, closed a claw on empty air, carried nothing across the field, and carefully placed nothing in the basket. Then it backed away pleased with itself.
Every program you have built does this. They all assume everything goes right.
Something goes slightly wrong in a real match — a cube got bumped, your robot drifted an inch. How much of your run is ruined?
You never follow a plan blindly. You check things and pick. Fill in what you would do:
| If this is true… | …I do this. Otherwise I do this. |
|---|---|
| It is raining outside | |
| The milk smells bad | |
| My bag feels lighter than it should |
That last one is exactly what your robot needs — a way to notice that it is carrying nothing.
The orange Control shelf has one more pair of jaws: the if-then block. It asks a hexagon question once, and only runs what is in its jaws when the answer is true.
The hexagon is written exactly the way your wait until and repeat until hexagons are — same shapes, same comparisons, same not.
| Code / part | What it means |
|---|---|
| wait until / repeat until | Keeps asking. Checks, runs, checks again… until the answer changes. The robot stays there. |
| if — asks once | Checks once. Runs the jaws once if true, skips them if false. Either way the robot moves on immediately. |
Same Hexagons, Completely Different Job
Until = “keep doing this until something changes.” If = “look at this once, then decide what happens next.”
Swap one for the other by accident and your robot either freezes in place or blows straight past a check it needed to make.
| Code / part | What it means |
|---|---|
| two separate ifs | if (shoes are on) — go for a walk. if (I am hungry) — eat a snack. Two questions about different things. Both can be true, both false. They do not affect each other. |
| if / else | if (shoes are on) — go for a walk. else — watch TV. The if-then-else block has two mouths, and exactly one of them runs, always. Else has no hexagon — it means “every other possibility.” |
| a chain of choices | Need three paths? Put a second if-then-else inside the else mouth of the first. Checked top to bottom — the first true one runs, and everything below is skipped even if it is also true. |
Order Changes the Answer
In a chain, the robot stops at the first true question. So put the most specific check first and the catch-all last — or your specific case will never get a look in.
Here is the check that fixes your sabotaged run — and it costs no extra sensor at all.
Think about what “closed” means. Your claw closed number is where the claw stops because the cube is in the way. Close the claw on empty air and nothing stops it — it swings past that number.
For that trick to work, the close itself has to change. A run-for block always swings the exact degrees you asked for — cube or no cube, it lands on the same count, and the count tells you nothing. So the grab check uses a timed squeeze instead: switch the claw motor on toward closed, give it a second, switch it off. A cube stops the squeeze early. Empty air lets it swing right on past.
The claw motor’s own degree count, which the brick has been keeping since Project 3, just became a sensor. It starts at 0 at claw-open — that is the Start Pose Rule earning its keep. Whether your empty claw ends up at a bigger or smaller number than your grip point depends on which way your claw closes — check yours by hand and flip the hexagon if needed.
New project called Decisions. Build: if (1 is pressed?) then — play beep for 0.2 seconds. Run it twice — once holding the sensor pressed, once not.
What happened each time — and how fast did the program end when you were not pressing?
Replace the if with wait until (1 is pressed?), beep after it. Run it without pressing.
What is the robot doing now, and how is it different from the if version? Use the words “once” and “keeps”.
Swap it back.
Now a real two-way choice. Build: at the start of a program, wait 3 seconds — your window to press or not — then:
Hold the sensor during the wait → robot turns right. Do not → it turns left. One program, two behaviours, chosen at run time.
Open your grab block from Project 12. Swap its claw-close for the timed squeeze from Learn It, then add the empty-claw check right after it: if the claw count is past claw closed by more than about 10, show the sad face and stop; else, carry on.
Test it honestly: run with a cube in place, then run with the cube moved away.
Your robot just told you something went wrong instead of carrying air across the field. What should it do about it — try again, skip to the next mission, or stop? Who decides?
Build a chain: press within the first 3 seconds → the full run; press and hold → just the grab test; no press → a beep and stop. Use an if-then-else with a second if-then-else inside the else mouth.
Why does the order of the questions in your chain matter? What would go wrong if you asked them the other way round?
Mission 3
Create one stack consisting of a Green Cube a Yellow Cube, or a Yellow Cube a Green Cube.
Create a second stack consisting of a Green Cube and a Yellow Cube.
Create two stacks such that one contains a Green Cube a Yellow Cube, and one contains a Yellow Cube a Green Cube (opposite color arrangements).
Going for Advanced Gets You the Bonus Too
Two opposite stacks are two stacks. Score the Advanced Bonus and the 9-point Bonus comes with it — 22 points from this one run.
⚠ Four Cubes, Four Jobs
Each cube may contribute to only one scoring stack. You need two greens and two yellows, and every one of them has a specific place to be. Get the second stack’s colours the wrong way round and you drop from 22 points to 9.
Where the decisions go. This run has four grabs and four placements in a row. If grab two fails and the robot does not notice, everything after it is wasted. Put a check after each grab — the pattern from step 4 — so a miss costs you one cube instead of the whole mission.
Plan it out. Which cube goes where, and in what order?
| Step | Cube | Goes where | Check after? |
|---|---|---|---|
| 1 | |||
| 2 | |||
| 3 | |||
| 4 |
| Run | Two stacks? | Opposite arrangement? | Did a check catch a miss? | Points |
|---|---|---|---|---|
| 1 | ||||
| 2 | ||||
| 3 | ||||
| 4 | ||||
| 5 |
| Mission part | Scored? | Points |
|---|---|---|
| Mission 3 — Bonus (a second mixed stack) | 9 | |
| Mission 3 — Advanced (opposite arrangements) | 13 | |
| My total this project | 22 |
Which tool fits each job — an if, a wait until, or a repeat until?
| The robot should… | Tool |
|---|---|
| Keep driving until the sensor is pressed | |
| Check once whether the claw is empty, then choose | |
| Do nothing until the match-start tap | |
| Steer left or right depending on what it sees, over and over |
| The stack | What goes wrong |
|---|---|
| An if (pressed?) used to wait for the match-start tap | |
| A wait until (pressed?) where a quick one-time check was meant | |
| In a chain, the catch-all question placed first |
In Try It your robot carried nothing across the field and placed it carefully in a basket. Would you call that a mistake by the robot, or a mistake by the programmer?
A robot that checks its own work looks smarter than one that does not. Is it actually smarter, or is it something else?
Every decision you made today came from a switch — pressed or not pressed. What kinds of choices could your robot make if it could tell how much of something there is, instead of just yes or no?
Everything your robot senses right now is on or off. The field is not like that — a black line and a white mat are not two states of a switch, they are two brightnesses.
In Project 14 — Seeing Light and Dark, your robot gets a sensor that answers with a number instead of a yes.
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