Skip to content

make_something

Get the robot home

Build a program out of blocks, press Go, and watch it run. If the robot does not get there, you fix the program and try again. That is the whole job.

level 1 of 5

tap a block to add it

your program (tap a block to remove it)

What the if block is for

The first three levels can be solved by listing the moves in order, because you can see exactly where the rocks are. The last one cannot: the rock moves every time you press Go, so there is no fixed list that always works.

That is what if is for. An if block asks a question before doing anything: is there a rock in front of me? If yes, do one thing. If no, do the other. The program stops being a fixed list and starts making decisions while it runs.

Every app on the phone you are holding is full of these. Is the battery low, is there wifi, is the password right. Same idea, bigger program.

next

Now write it as real code

Blocks are training wheels and they come off quickly. The first real Python lesson is here, and it runs on the same phone.

All the things you can make