Math · Foundational · Lesson 5 of 9
If This, Then That
Conditions and while loops
An interactive lesson with 7 steps, about 6 minutes: you predict, drag and solve, with instant feedback on every answer. It runs in your browser and needs JavaScript.
What you’ll learn
- An if block runs only when its condition is true; else covers the other case.
- A while loop repeats until its condition becomes false.
- A loop whose condition never changes runs forever.
Steps
- A robot with sensors
- One program, two grids
- Which branch runs?
- While loops
- Any length of corridor
- Follow the path
- A fork in the road