Lesson 1: Sequencing in the Maze
Overview
In this set of puzzles, students will begin with an introduction (or review depending on the experience of your class) of Code.org's online workspace. There will be videos pointing out the basic functionality of the workspace including the Run
, Reset
, and Step
buttons. Also discussed in these videos: dragging Blockly blocks, deleting Blockly blocks, and connecting Blockly blocks. Next, students will practice their sequencing and debugging skills in the maze.
Debugging is an essential element of learning to program. Students will encounter some puzzles that have been solved incorrectly. They will need to step through the existing code to identify errors, including incorrect loops, missing blocks, extra blocks, and blocks that are out of order.
Purpose
We recognize that every classroom has a spectrum of understanding for every subject. Some students in your class may be computer wizards, while others haven't had much experience at all. In order to create an equal playing (and learning) field, we have developed these ramp-up lessons. This can be used as either an introduction or a review of how to use Code.org and basic computer science concepts. Students in your class might become frustrated with this lesson because of the essence of debugging. Debugging is a concept that is very important to computer programming. Computer scientists have to get really good at facing the bugs in their own programs. Debugging forces the students to recognize problems and overcome them while building critical thinking and problem solving skills.
Agenda
Warm Up (15 min)
Main Activity (30 min)
Wrap Up (5 - 10 min)
Extended Learning
View on Code Studio
Objectives
Students will be able to:
- Order movement commands as sequential steps in a program.
- Modify an existing program to solve errors.
- Break down a long sequence of instructions into the largest repeatable sequence.
- Predict where a program will fail.
- Modify an existing program to solve errors.
- Reflect on the debugging process in an age-appropriate way.
Preparation
- Play through the puzzles yourself to find any potential problem areas for your class.
- (Optional) Pick a couple of puzzles to do as a group with your class.
- Make sure every student has a journal.
- Review Debugging Recipe - Student Handout with the class.
Links
Heads Up! Please make a copy of any documents you plan to share with students.
For the Students
- Unplugged Blocks (Courses C-F) - Manipulatives
- Debugging Recipe - Student Handout
Vocabulary
- Bug - Part of a program that does not work correctly.
- Debugging - Finding and fixing problems in an algorithm or program.
- Program - An algorithm that has been coded into something that can be run by a machine.
- Programming - The art of creating a program.
Support
Report a Bug
Teaching Guide
Warm Up (15 min)
Introduction
Ask students to think about problems they have to solve in everyday life.
- How do you fix something that isn't working?
- Do you follow a specific series of steps?
- Some puzzles in this lesson have already been solved for you (yay!), but they don't seem to be working (boo!)
- We call the problems in these programs "bugs," and it will be your job to "debug" them.
Students will either be learning a lot of new concepts or reviewing a lot of basic concepts. Based on your class's experience, you can cover the following vocabulary. We recommend using the following words in sentences if the definitions aren't explicitly covered.
Vocabulary
This lesson has four new and important vocabulary words:
-
Program - Say it with me: Pro - Gram An algorithm that has been coded into something that can be run by a machine.
-
Programming - Say it with me: Pro - Gramm - ing The art of creating a program.
-
Bug - Say it with me: Bug An error in a program that prevents the program from running as expected.
-
Debugging - Say it with me: De - Bugg - ing Finding and fixing errors in programs.
Say:
Debugging is a process. First, you must recognize that there is an error in your program. You then work through the program step by step to find the error. Try the first step, did it work? Then the second, how about now? If you make sure that everything is working line by line, then when you get to the place that your code isn't doing what it's supposed to, you know that you've found a bug. Once you've discovered your bug, you can work to fix (or "debug") it!
If you think it will build excitement in the class you can introduce the character of today's puzzles, Scrat from Ice Age. If students aren't familiar with Scrat, show some video clips of the quirky squirrel running into trouble.
Main Activity (30 min)
Online Puzzles
Teacher Tip:
Show the students the right way to help classmates:
- Don’t sit in the classmate’s chair
- Don’t use the classmate’s keyboard
- Don’t touch the classmate’s mouse
- Make sure the classmate can describe the solution to you out loud before you walk away
Teachers play a vital role in computer science education and supporting a collaborative and vibrant classroom environment. During online activities, the role of the teacher is primarily one of encouragement and support. Online lessons are meant to be student-centered, so teachers should avoid stepping in when students get stuck. Some ideas on how to do this are:
- Utilize Pair Programming - Student Video whenever possible during the activity.
- Encourage students with questions/challenges to start by asking their partner.
- Unanswered questions can be escalated to a nearby group, who might already know the solution.
- Remind students to use the debugging process before you approach.
- Have students describe the problem that they’re seeing. What is it supposed to do? What does it do? What does that tell you?
- Remind frustrated students that frustration is a step on the path to learning, and that persistence will pay off.
- If a student is still stuck after all of this, ask leading questions to get the student to spot an error on their own.
Before letting the students start on the computer, remind them of the advantages of Pair Programming - Student Video and asking their peers for help. Sit students in pairs and recommend they ask at least two peers for help before they come to a teacher.
As mentioned in the purpose of this lesson, make sure the students are aware that they will face frustrating puzzles. Tell them it is okay to feel frustrated, but it is important to work through the problem and ask for help. As the students work through the puzzles, walk around to make sure no student is feeling so stuck that they aren't willing to continue anymore.
Wrap Up (5 - 10 min)
Journaling
Having students write about what they learned, why it’s useful, and how they feel about it can help solidify any knowledge they obtained today and build a review sheet for them to look to in the future.
Journal Prompts:
- What was today’s lesson about?
- How did you feel during today’s lesson?
- What kind of bugs did you find today?
- Draw a bug you encountered in one of the puzzles today. What did you do to "debug" the program?
Extended Learning
Use these activities to enhance student learning. They can be used as outside of class activities or other enrichment.
Planting bugs
Have students go back through previous levels, purposefully adding bugs to their solutions. They can then ask other students to debug their work. This can also be done with paper puzzles.
When other students are debugging, make sure that the criticisms are constructive. If this could be a problem for your class, go over respectful debugging before this activity by role playing with another student.
- Maze Intro: Programming with Blocks
- 1
Student Instructions
For this puzzle, snap all of the blocks together and click "Run" to watch it go!
Student Instructions
Drag an extra move forward
block out of the toolbox, then attach all blocks to when run
to finish your code.
Student Instructions
Student Instructions
Help the bird get to the pig. There is one extra blue move forward
block.
Throw away the extra block by removing it from the other blocks and dragging it back to the toolbox.
- Debugging with the Step Button
- 6
Student Instructions
Student Instructions
"Trace the path and lead me to the acorn."
Student Instructions
Student Instructions
- Challenge
- 11
Student Instructions
Student Instructions
Count the spaces on the grid carefully!
Student Instructions
Help Scrat get to the acorn.
Standards Alignment
View full course alignment
CSTA K-12 Computer Science Standards (2017)
AP - Algorithms & Programming
- 1B-AP-08 - Compare and refine multiple algorithms for the same task and determine which is the most appropriate.
- 1B-AP-11 - Decompose (break down) problems into smaller, manageable subproblems to facilitate the program development process.