# Hour of Code

Lesson 3 of 10

## Objective: SWBAT make sense of some fundamentals of computer programming.

When students arrive in the computer lab for today's class, I've posted a link to today's assignment on the board (http://www.hourofcode.com/co), along with this quote:

As students get to their computers and type the link into their browsers, I ask them if they buy the quote on the board, and sometimes it starts a cool little conversation.

Today, my job is to bring this idea to life. As part of Code.org's Hour of Code (Dec. 9-13, 2013), we're spending one class period in our year of Algebra 1 learning come basic computer programming. Of course, I think that learning to code is a valuable experience in itself, but I also hope to highlight some of what Steve Jobs is saying here about learning how to think. The problem solving and visual-abstract thinking students will do today can extend to a lot of what they need to learn in this course.

*expand content*

#### Work Time

*35 min*

Today's lesson plan is simple as they come: greet kids, give them the link (http://www.hourofcode.com/co) and see what happens. Actually, I have to work to keep myself in check today. There's so much I want to say to kids, but it's really best that I shut up and let kids have their own great thoughts. Of course, I'll jump on the opportunity to help if they ask for it, but I don't want to say too much. And I'll definitely save my grander connections to the algebra curriculum for later.

So with that in mind, my best recommendation to you is that you just check it out for your self, and see what connections you make to your teaching. The link I'm sharing here, http://www.hourofcode.com/co, directs to one of a dozen or so free lessons rolled out during the Hour of Code on December 9, 2013. The lessons are still up for anyone to try, and you can see a full list of lessons - for various grade-levels and levels of experience - here: http://code.org/learn.

The lesson we're doing here assumes no experience in computer programming, and it employs all sorts of high-engagement tactics: celebrity cameos, fantastic scaffolding, and angry birds. Over the course of solving 20 problems, students will see *for *loops, *do-while *loops, and *if-then-else* statements, each of which are used to make three basic lines of code: *move forward, turn right, and turn left* accomplish a task as efficiently as possible. The only clarifying point I had to make to every class was on Problem #9. Many students didn't recognize that they could put multiple lines of code within a loop - again, check it out for yourself.

It's fun to trust the inherent motivational force of a task enough to script nothing today. I trust that kids will ask the right questions and that everyone will learn what they can. Out of the 115 students I saw today, no one disengaged from this work. My enactment of the lesson is different with every student. To try to document, in detail every conversation that happened today would take pages and pages.

Instead, I want to list just a few takeaways, and I'll organize them by Mathematical Practice:

**MP1: Make sense of problems and persevere in solving them.***What is this problem asking me to do, and how I am going to do it?*Today's tutorial is organized as a series of problems, with each one adding a new twist or degree of difficulty. My students recognize the role that perseverance plays today. The good news is that these tasks are fun enough that 100% of my students are engaged enough to want to persevere. Some kids get frustrated and talk about quitting, but it is not too hard to draw them back in with a few pointers. We work together to make sense of the function of each code block.**MP2: Reason abstractly and quantitatively & MP7: Look for and make use of structure.***What will happen if I...?*Using code blocks to a make an angry bird or a zombie move across the screen (when I was in college, we programmed Buggles - anyone else?) is a fundamentally abstract task. As I circulate today, I try to get students to visualize what's going to happen before they run the code, and to rate their level of certainty as to how well the code will work. Translating between the structure of the code blocks and the structure of what's happening on the screen is a great mental workout. Breaking a problem into parts exposes its underlying structure. It's also neat to watch kids think about what "turn left" and "turn right" mean to a character on the screen, as opposed to someone looking at the screen.**MP5: Use appropriate tools strategically.***How can I use just a few lines of code to accomplish this task as efficiently as possible?*A line of code is a precise tool - and it's paramount to the success of a programmer to make a program run on as few lines as possible. An indicator at the top of the screen shows students how many lines of code they've used, and gives them a target. Especially once loops are introduced, there are ways to accomplish the same task is 20 lines or in 4 lines of code. I try to keep an eye out for kids who are using too many lines, and then I show them the power of the tools in front of them.**MP8: Look for and express regularity in repeated reasoning.***Is there a pattern on that path?*The use of any sort of loop requires students to see some repetition in the process. Once students can see the regularity of the shapes that repeat on these paths, they can figure out the few lines of code that will need repeating. Take a look at the second half of this problem set - the zombie problems - and see how these paths repeat the same few shapes. A few of the zombie problems with zig-zag paths make me think about the repetitive structure of "rise-over-run", and this is a connection I'll try to get kids to make in tomorrow's opener.

#### Resources

*expand content*

With a few minutes left in class, I ask students what they thought about today's work. They're eager to share, and it's nice to hear them summarize what happened today. I also ask if anyone would like to continue this work. I show them that code.org is hosting more lessons in which students can actually type their own code, write iOS apps, design graphics, and more. Interest is high, so moving forward, I'll host students after school who would like to continue with this work.

This is also a locally political issue, and when students tell me that they think we should offer classes like this in school, I direct to their student council and administration. "I'll be happy to support you in an effort to bring coding to school," I say, "but I really want it to come from you. So how should we start?"

*expand content*

- UNIT 1: Number Tricks, Patterns, and Abstractions
- UNIT 2: The Number Line Project
- UNIT 3: Solving Linear Equations
- UNIT 4: Creating Linear Equations
- UNIT 5: Statistics
- UNIT 6: Mini Unit: Patterns, Programs, and Math Without Words
- UNIT 7: Lines
- UNIT 8: Linear and Exponential Functions
- UNIT 9: Systems of Equations
- UNIT 10: Quadratic Functions
- UNIT 11: Functions and Modeling

- LESSON 1: "The Answer" vs. "The Problem"
- LESSON 2: Seeing Structure and Defining Problems
- LESSON 3: Hour of Code
- LESSON 4: Seeing Structure in Dot Patterns and Linear Functions
- LESSON 5: Make Your Own Dot Pattern
- LESSON 6: Function Diagrams
- LESSON 7: Equivalent Line Segments
- LESSON 8: Introduction to Desmos
- LESSON 9: Summary, Work Folders, and a Quiz
- LESSON 10: Building Towers