- Grades 3 - 5
- Beginner level
- 10 lessons
- Tynker Blocks
- Web iPad
- 10 lessons
- 67 activities
- Enhanced Creativity Tools
- Automatic Assessment
- Tutorials and Reviews
- Coding Puzzles
- DIY Projects
- Answer Keys
No previous coding experience required.
Course: Dragon Spells
Lesson 2: Blast Through
Number of Levels: 6
Time: 30+ mins
IntroductionThe puzzles in this lesson introduces students to debugging, which is the process of finding and fixing programming errors. In each puzzle, students are given a puzzle and a piece of code that has a bug in it. Students will need to fix the bug so the dragon can reach the treasure.
New Code Blocks
- Debugging: The process of finding and fixing programming errors
- Bug: An error in a piece of code
- Apply coding concepts to troubleshoot and debug programs
- iPads (with installed Tynker app), computers, or laptops
Warm-Up (5 minutes)Inform students that in today's coding activities, they're going to be given puzzles that need to be debugged, which is the process of finding and fixing programming errors. Prepare students for today's activities by asking them to discuss the following:
- Can you think of a situation when your program didn't work as intended? What did you do to fix your code?
- As a class, create a list of strategies that your students can refer to as they complete today's debugging activities.
- See if there are extra code blocks
- Write which code blocks you need to use to solve the puzzle
- Remove all code blocks and start over
- Break down your code
- Think out loud through your steps
- Ask the teacher/a friend for help)
- Optional research activity: Encourage students to practice their research skills and find out where the term "computer bug" comes from.
Activities (30 minutes)Facilitate as students complete all Blast Through modules:
- Inform students that this lesson has 6 levels that they need to complete.
- Tell students that the puzzles have already been solved, but the solutions are buggy! They will need to analyze the provided code and fix the bug.
- Are students struggling? Here are different debugging strategies your students can try:
- Run the buggy code to see what happens. Next, modify the code.
- Read through the buggy code and use a finger to trace what should be happening to the character as each code block is executed. Also encourage students to say the steps out loud.
- Ignore the buggy code and write out what their character needs to do. Then compare that code to the buggy code.
- Are students struggling? Here are some hints to help them get started…
- Level 1: Add 3 "walk" code blocks.
- Level 2: Switch the order of the last two code blocks. Students will also need to add 1 "turn around" and 1 "walk" code block.
- Level 3: Switch the order of the last two code blocks. Students will also need to add 1 "walk" code block.
- Level 4: Switch the order of the first two code blocks. Students will also need to add 1 "turn around" and 4 "walk" code blocks.
- Level 5: The dragon can only store one “blast” at a time. So “eat” the icefly, “turn around” and “blast” to put out the fire, then eat the second bug and solve the rest of the puzzle. Make sure students add the following code blocks: 2 "turn around" blocks, 1 "blast" block, and 3 "walk" blocks.
- Level 6: The order of the last 3 code blocks should be: blast - walk - walk. Make sure students add the following code blocks: 1 "turn around" block and 2 "walk" blocks.
Extended Activities (10 minutes)Discussion
Ask your students…
- What is a strategy you can use when debugging your program? (Answers will vary)
- True or false: In coding, "finding a bug" is when you see an insect running across your screen. (Answer: False, a "bug" is an error in your code)
- What can debugging your code teach you? (Examples: How to be more patient, how to think logically through your code, perseverance)
- CCSS-Math: K.CC.B.5, 2.OA.B.2, MP.1
- CCSS-ELA: RF.K.4, RF.1.4, RF.2.4, RF.1.4.A, RF.2.4.A, 1.RI.10, 2.RI.10
- CSTA: 1A-AP-09, 1A-AP-11, 1B-AP-11, 1B-AP-15
- CS CA: K-2.AP.13, 3-5.AP.10, 3-5.AP.13, 3-5.AP.17
- ISTE: 1.c, 1.d, 4.d, 5.c, 5.d, 6.b
U.K. StandardsKey Stage 1
- Use logical reasoning to predict the behaviour of simple programs
- Use technology safely and respectfully, keeping personal information private; identify where to go for help and support when they have concerns about content or contact on the internet or other online technologies
- Design, write and debug programs that accomplish specific goals, including controlling or simulating physical systems; solve problems by decomposing them into smaller parts.
- Use logical reasoning to explain how some simple algorithms work and to detect and correct errors in algorithms and programs.
- Understand computer networks, including the internet; how they can provide multiple services, such as the World Wide Web, and the opportunities they offer for communication and collaboration.
- Use technology safely, respectfully and responsibly; recognise acceptable/unacceptable behaviour; identify a range of ways to report concerns about content and contact.