Teacher's Guide
Chapter 4 / Level 1: Creating a message
Teaching Objective:
- Students learn what Async functions are
- Understand that Async functions begin with
await - Learn how to use the
write()function in an exercise
Guide
In this exercise we will be learning about await/async functions, in particular the write() function. This function allows you to write an message and have it displayed as a pop up. This level’s objective is to label the unmarked crates using the write() function and tally the number of items in each crate.
Walk to light X marks by the crates with colored carpets and use the speak() function to identify the contents of each crate. Use the built in constants : green_crate , blue_crate , red_crate , and orange_crate with the function at the colored carpet designated by the name of the constant.
Once you find out what type of produce is inside the crate use the write() function to label the sign. There will be four (4) different types of produce that can be labeled :"potato" , "onion" , "corn" and "carrot" .
player.speak(green_crate)
await player.write("potato")
.............
player.speak(red_crate)
await player.write("onion")
.............
player.speak(orange_crate)
await player.write("corn")
.............
player.speak(blue_crate)
await player.write("carrot")
Finally, walk to the gold X mark and add together all constants inside a list named all_crates . Follow this up by using the write() function with the list in order to complete the level.
all_crates = [ green_crate , blue_crate , red_crate , orange_crate ]
await player.write(all_crates)
Map overview and path

Code Solution
import player
player.turn_left()
player.move_forward(2)
player.turn_left()
player.move_forward(3)
player.turn_left()
player.move_forward()
player.speak(green_crate)
await player.write("potato")
player.turn_right()
player.move_forward(2)
player.turn_left()
player.speak(red_crate)
await player.write("onion")
player.turn_left()
player.turn_left()
player.move_forward(2)
player.speak(orange_crate)
await player.write("corn")
player.turn_right()
player.move_forward(2)
player.turn_left()
player.speak(blue_crate)
await player.write("carrot")
player.turn_left()
player.move_forward(3)
player.turn_left()
player.move_forward()
player.turn_right()
all_crates = [ green_crate, blue_crate, red_crate, orange_crate ]
await player.write(all_crates)