design, write and debug programs that accomplish specific goals, including controlling or simulating physical systems; solve problems by decomposing them into smaller parts.

3.2a

LO: To write and edit functions.

Using the Objects world, let children think about other skills might come in handy for Reeborg, write some functions to give Reeborg those abilities.

#Year group or class
#name				
#date
#objects maze

#functions to try out

def turn_right():
    turn_left()
    turn_left()
    turn_left()

def turn_around():
    turn_left()
    turn_left()

def get_banana():
    move()
    turn_left()
    move()
    move()
    take()
    turn_around()
    move()
    move()
    turn_right()
    move()
    turn_around()

			

Lets look in more detail at these functions...

Code Examples

Resources