Wick's Block Isle · Lesson 5

Build Towers

Use def to wrap lines of code into your own function

Watch

Define a function called tower, then call it twice to build two towers 3 blocks high.

def tower():
    for i in range(3):
        place("stone")

tower()
move("right", 2)
tower()

Guess

The same code. It pauses before the second call: predict, then check.

Change

Both towers must be 4 high. Change one number.

Make

Build steps on the dotted blocks: heights 1, 2, 3 and 4. The function needs an argument.

def tower():
    for i in range(3):
        place("stone")

tower()