- 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 7: Catch Me If You Can
Number of Levels: 6
Time: 30+ mins
IntroductionIn this lesson, students are introduced to conditions and conditional statements. A condition is something we can check if it is true or false. For example, we can check if the dragon has reached the pile of treasure. If the dragon is at the treasure, the condition is true. Otherwise, the condition is false. A conditional statement gives certain instructions when certain conditions are true. In today's coding adventure, students will be using "if" statements to help the dragon reach the treasure. An "if" statement is a conditional statement that gives instructions only if the condition is true. For example, if you said the if statement “If you’re happy, clap your hands”, your students would only clap their hands if they are happy. Otherwise, the command “clap your hands” would be ignored.
New Code Blocks
: If the condition is true, then run the code inside this block.
- Conditional statement: A statement that depends on a condition that is either True or False.
- Use conditional statements
- Apply coding concepts and logic to solve puzzles
- iPads (with installed Tynker app), computers, or laptops
Warm-Up (5 minutes)Explain to students that "if-else" statements execute one group of commands if something (a condition) is True. Otherwise, it executes the commands inside the "else" case. Next ask them to write 3-5 real-world examples of "if-else" statements. Here's an example: If it's raining outside, then I will wear my rain boots. Otherwise, I'll leave by rain boots at home. If students are struggling, here are some prompts to help them get started:
- If I get enough sleep, then…otherwise…
- If it's Saturday, then…otherwise…
- If I hear the fire alarm, then...otherwise…
Optional: Encourage students to share their examples with the class.
Activities (30 minutes)Facilitate as students complete all Catch Me If You Can modules:
Catch Me If You Can
- Inform students that this lesson has 6 levels that they need to complete.
- To solve levels 1-2, students will need to use the “if” block to check if there is a bug in front of the dragon for it to eat. They'll also need to program the dragon to walk past the fire and get to the pile of treasure. Give a hint: Ask students to place the "if" block inside the "repeat" code block.
- Remind students that they can change the value of the "repeat" loop.
- In levels 3-5, students need to use an "if" block. Give a hint: Ask students…
- What does the dragon need to do if there is a bug? (Answer: Eat it).
- What does the dragon need to do after it eats the bug? (Answer: Walk).
- Level 6 is more challenging compared to previous levels. Encourage students to work with a partner, group their code into small sections, and write their steps before adding code blocks.
Extended Activities (10 minutes)Discussion
Ask your students…
- Using your own words, describe how conditional statements work. (Answers will vary)
- How did you apply conditional logic in today's coding activities? (Answers will vary)
- 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.