← Map
Dart Island · Level 3
Learn Flutter

Eight if/else games

Conditions are how Dart makes decisions. Each game teaches a different angle — reading, tracing, building, and finally writing conditions yourself.
Complete all eight mini-games to master branching logic.
What is an if / else condition?

A condition is a decision point in your code. Dart checks whether something is true or false and then runs different code depending on the answer.

if (score >= 90) {
print("You passed!");
} else if (score >= 60) {
print("Almost there.");
} else {
print("Keep practising.");
}
  • if — the first check. Runs only when its condition is true.
  • else if — a second (or third, fourth…) check. Only reached when the previous if was false.
  • else — the fallback. Runs when none of the above conditions matched.
Comparison operators
==equals
!=not equals
>greater than
<less than
>=greater or equal
<=less or equal

Complete all 8 mini-games below to build a solid understanding of conditions — from reading them to writing your own.

Progress
0 / 8 mini-games solved
Stage 1

Traffic light

Pick the right if/else branch for each light colour.

The traffic light is showing a colour. Read the Dart code and choose what happens next. Each round teaches you a different branch.

if (light == "green") { go(); }
Data Types