Conditions for kids: MRT Station

Wait for the fare gates and train doors. Timing is everything.

  • Free
  • No sign-up
  • Ages 6–12
  • Works on Chromebooks and iPads

What are conditions?

A condition lets a program make a decision: if something is true, do one thing; otherwise (else), do something different. Conditions are how programs react to the world. A game checks if you pressed jump, and a traffic light checks if a car is waiting.

At the MRT station, the fare gates and train doors open and shut on a timer. Your robot can't walk through a shut gate, and it can't board while the doors are closed. You could count the exact number of waits, but then your program only works for one timetable. Using "if the gate is shut, wait, else move" gives you a program that works whenever the robot arrives.

This world also brings in "repeat until finished", a loop that keeps going until the job is done instead of a fixed number of times. Putting a condition inside that loop is one of the most common patterns in real code. Programs check, act, and check again.

Using the Robot Maze in class?

Make a class: students join with a code and a nickname, and you see everyone's stars, and who is stuck, as they play. 14 days free, then S$2.99 a month or S$29 a year. Every world also has a free 45-minute lesson plan with answer keys.