Loops, If-Else & Functions for kids: Changi Airport

Sort luggage onto the right belts with loops, conditions and functions.

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

How do loops, conditions and functions work together?

Real programs rarely use just one idea. They put conditions inside loops, and loops inside functions, building big behaviour out of small pieces. This world brings together everything from the earlier worlds: sequencing, loops, conditions and functions.

At Changi Airport the bags come off the carousel one at a time, red or blue, and every bag has to go on the belt that matches its colour. Your robot can't know the order in advance, so it has to check each bag with a condition. Then a loop handles every bag, and a sort_bag function keeps the program short and readable.

If your robot can sort the luggage, you have used the same building blocks as every app, game and website. Press "Show me the Python" on any level to see your blocks as real Python code, the language our older students use to build their own AI.

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.