← Map
Dart Island · Level 3
Learn Flutter

12 loop missions: for first, while later

Loops are how Dart repeats actions. We start with for loops, because they are the clearest way to learn the idea of repetition. After that, we introducewhile loops with a calmer, easier pace.
Complete every challenge to understand loops deeply.
First: master the for loop

We will learn for loops first. A for loop is perfect when you already know how many times you want to repeat something. Only after that do we introduce while loops, which keep going until a condition becomes false.

for (int i = 0; i < 3; i++) {
print(i);
}
int steps = 0;
while (steps < 3) {
print(steps);
steps++;
}
  • for — best when the number of repeats is known.
  • while — introduced later for repeated actions that depend on a changing condition.
  • Every loop needs a stopping rule, otherwise it can run forever.

Play through all 12 mini-games below to build confidence with loop logic step by step.

Progress
0 / 12 loop missions complete
Mission 1

For starter

Pick the loop that repeats a known number of times.

Mission 1

The robot needs to print 4 stars.

You know exactly how many times you want to repeat the task. Which loop should you pick?

Conditions