This brief lesson will help prepare students to program Anna and Elsa in the Hour of Code activity. Students will "program" one another to draw shapes using a sequence of simple instructions. As students progress through the Hour of Code online, encourage them to refer back to this activity as they think about how to program Anna and Elsa.
Activity: The Drawing Machine
4) Flash Chat - Taking it online
- Recognize situations where they can create programs to complete tasks
- Predict moves necessary to draw a shape
- Convert movements into written instructions
- Relate algorithms as programs to teammates
Materials, Resources and Prep
For the Teacher
- Teacher Lesson Guide
- Print one or more sets of Drawing Machine Commands for students
- (optional) Print sets of Additional Drawing Commands
- Print one Marker Template, cut it out and tape it to a whiteboard marker
- Print or display on overhead Angles Reference
- Print or display on overhead Shapes to Draw
This lesson has one new and important word:
Program - Say it with me: Pro-gram
An algorithm that has been coded into something that can be run by a machine.
- Ask students to think of a time when they've explained how to do something complicated to another person.
- When we explain how to do a complex task, how do we make sure the person understands?
- Break it up into smaller steps.
- Make sure the steps are in the right order.
- Be specific.
- Programming a computer is a lot like giving directions to a person, except that computers aren't as smart as we are.
- When you get confusing instructions, what do you do?
- Take a guess at what was meant.
- Ask for clarification.
- Observe other people following the instructions.
- You probably have lots of other techniques for filling in the gaps that you're not even aware of.
- Computers don't know how to work with poor instructions, so before we start programming, we're going to practice giving good instructions.
The student being "programmed" will often try to help the programmers by doing what they think was intended, even when the instructions weren't right. Make sure that the students are only doing exactly what they've been programmed to do. You may want to model this behavior be allowing the class to "program" you first.
Directions for Class:
- Select one student to be the Drawing Machine.
- Divide the drawing commands up among students.
- The Drawing Machine will start by standing at the whiteboard with a marker that has the marker template attached.
- Give the class one of the shapes to draw; it should not be shared with the Drawing Machine.
- Using the drawing commands students will come up with a sequence of instructions for the Drawing Machine.
- When the class is ready, they will give the instructions to the Drawing Machine to execute.
- Repeat with additional images, allowing other students to be the Drawing Machine.
Experiment with different ways for students to give their instructions:
- Verbally give each instruction, waiting for the Drawing Machine to execute each step before providing the next.
- Write all instructions down on a piece of paper.
- Lay the instruction sheets down in the proper order.
If students struggle with figuring out which angles to use, you can give them this angles reference sheet to help.
Understanding that the instructions are executed from the marker's point of view is essential to programming it. For example, turning left or right is done relative to current direction the marker is pointing (as seen by the purple triangle on the marker template). Encourage students to get up and use their bodies as they figure out the programs.
- In the game we just played, who do you suppose was more like a programmer, and who was more like a computer?
- What was the most challenging part of writing the instructions?
- When you go to do the Hour of Code remember the techniques you used to write good instructions. If you get stuck:
- Act out what you want Anna or Elsa to do
- Describe using plain English how they should move
- Make sure you are giving instructions in the right order and relative to where they're facing
If you'd like to extend this activity:
- Ask students to come up with new shapes or drawings to write instructions for.
- Add more drawing commands to your library of instructions, or even make some of your own.
- Have students program each other to do other activities, like navigating the hallways, building a block tower, or making a sandwich.