Write code to guide your Champion. Plan it, test it, fix it!
Every world starts with short Learn stations, then 16 coding levels. Progress saves on this device.
Tip: tap something again to remove it, or use the 🧽 Eraser.
Python reads your code from top to bottom. Lines inside a loop, if, or def must be indented 4 spaces. Lines that start with for, while, if, elif, else, or def end with a colon :
move_forward() | Move one square the way you face. move_forward(3) moves 3. | ⬆️ Move forward |
turn_left()turn_right() | Turn to face a new way. You stay on the same square. | ↺ ↻ Turn |
move_right() and friends | Move right, left, up, or down no matter which way you face. Used in Show Python for arrow blocks. | ➡️ ⬅️ ⬆️ ⬇️ |
for i in range(4):
move_forward() | Repeats the indented lines 4 times. | 🔁 Repeat 4 times |
while not at_flag():
move_forward() | Keeps repeating until the Champion reaches the flag. | 🔁 Repeat until 🚩 |
if path_ahead():
move_forward()
elif path_left():
turn_left()
else:
turn_right() | Checks the path. Runs the first part that is True. else runs when nothing above was True. | ❓ If / Else |
path_ahead() path_left() path_right() at_flag() | Checks that answer True or False. Use them with if or while. |
steps = 1 steps = steps + 1 steps += 1 steps -= 1 | A variable is a named box for a number. += adds to it, -= takes away. | 📦 steps |
move_forward(steps) | Moves forward as many squares as the variable holds. | |
print("Hi!") print(steps) | Shows a message or a value in the output box. |
def hop():
turn_left()
move_forward()
hop() | def makes a function. Its lines run only when you call it with hop(). Put the def above the code that uses it. | 🧩 Function |
When your Champion walks all the way around a shape and ends up facing the way it started, it has turned one full circle: 360°. So for a shape with corners that are all the same:
The Champion turns at the outside of each corner. A triangle’s inside corner is 60°, but the Champion turns 120°, because 180 − 60 = 120. Turn angle = 180 − inside angle.
Tip: press 📐 Protractor to see angle marks around your Champion. Blue numbers are right turns, orange numbers are left turns.
You used a big hint, so this level can earn up to 2 stars this time.
Type the maze code your friend gave you.