Programming 1A Lesson Plan

Lesson: Conditional Loops

Time: 80+ mins

Introduction

In this lesson, students use conditional loops and path detection to help a spaceship stay on the course.

Tynker Blocks Introduced

  • : Make the Actor repeat this loop while the condition is true.

Vocabulary

  • No new terms are introduced in this lesson.

Objectives

Students will...

  • Evaluate when to use "repeat while" and "repeat until" code blocks
  • Apply conditional logic and loops to solve puzzles

Materials

  • Computers (1 per student) with student account access to Tynker.com

Warm-Up (20 minutes)

  1. Inform students that we are going to use a combination of loops and conditions in today's coding adventure. Can anyone remind the class what a repeat loop does? (repeats an action over and over)
  2. Write the following on the classroom board:
    • Walk forward until I reach an obstacle.
    • While there is no obstacle in front of me, I will continue to walk forward.
  3. Act out the two statements. As a class, identify if the statement is an example of a "repeat while" or a "repeat until" loop.
  4. Who can identify what action keeps repeating over and over in the two statements? (answer: walking forward).
  5. Ask, "What needs to happen to stop me from walking forward?" (answer: need to reach an obstacle).
  6. Encourage students to work with a partner and think of another example of a "repeat while" loop and a "repeat until" loop. Discuss.

Activities (40 minutes)

1. Conditional Loop (Puzzle)

  • Students can solve this puzzle by placing only "forward" blocks, but encourage them to use the "repeat until" conditional loop.
  • Give a hint: Tell students to attach one "repeat until" block below the "when touched" block.

2. Detect a Path (Puzzle)

  • This puzzle introduces the "repeat while" code block, which tells the spaceship to repeat a set of commands (move forward) while a condition is detected (path in front).
  • Students can solve this puzzle by placing only "forward" blocks, but encourage them to use the "repeat while" conditional loop.
  • Give a hint: Tell students to attach one "repeat while" block below the "when touched" block.

3. Turn to the Left (Puzzle)

  • This puzzle uses the "if" block inside a "repeat until" loop.
  • Remind students of today's warm-up activity. Say, "The spaceship needs instructions that tell it to react to the path turning left, and we can do that by using the 'if' and 'turn left' code blocks."
  • Give a hint: Tell students to attach one "repeat until" block below the "when touched" block.

4. Turn to the Right (Puzzle)

  • This puzzle is similar to the previous one, but in the other direction; the spaceship turns right rather than left.
  • Give a hint: Tell students to attach one "repeat until" block below the "when touched" block.

5. Left Spiral (Puzzle)

  • This puzzle gives students the option to use either "repeat while" or "repeat until." If students find one solution, challenge them to create a different solution.
  • Give a hint: Tell students to attach one "repeat until" block below the "when touched" block

6. Right Spiral (Puzzle)

  • This puzzle is similar to the previous one, but in the opposite direction; the path and spaceship turn right rather than left.
  • Give a hint: Tell students to attach one "repeat until" block below the "when touched" block.

Optional Activities (25 minutes)

Same Code, Different Paths:

Notice the "Answer Key" solutions in Modules 3 and 5 use the same code, even though the paths are different!

  1. Use the "Answer Key" solution to solve "Module 3: Turn to the Left."
  2. Display the solution on the classroom board.
  3. Open "Module 5: Left Spiral." Ask, "Do you think it's possible to solve this puzzle using the same code we used in our last puzzle (Module 3)?" Discuss.<
  4. Use the same code from Module 3 to solve Module 5. Ask, "How is this possible?" Discuss.

U.S. Standards

  • CCSS-ELA: RI.1.1, RI.1.6, RI.1.10, RF.1.4, RF.1.4.A, RF.1.1, SL.1.1, SL.1.2, SL.1.3, RI.2.1, RF.2.4, RF.2.4.A, RI.2.6, SL.2.1, SL.2.2, SL.2.3
  • CCSS-Math: MP.1
  • CSTA: 1A-AP-09, 1A-AP-10, 1A-AP-11, 1A-AP-14
  • CS CA: K-2.AP.10, K-2.AP.12, K-2.AP.13, K-2.AP.16, K-2.AP.17
  • ISTE: 1.c, 1.d, 4.d, 5.c, 5.d, 7.c

U.K. Standards

Key stage 1

Pupils should be taught to:

  • understand what algorithms are, how they are implemented as programs on digital devices, and that programs execute by following precise and unambiguous instructions
  • create and debug simple programs
  • use logical reasoning to predict the behaviour of simple programs
  • use technology purposefully to create, organise, store, manipulate and retrieve digital content
  • 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

Key stage 2

Pupils should be taught to:

  • 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
This course is not part of your plan. Please upgrade to view all answer keys

Class Presentations

These student-facing slide presentations help educators seamlessly run Tynker lessons in a virtual or physical classroom setting. Each lesson has its own set of slides that introduce the big ideas, suggest unplugged activities, and include a section for each activity module. While running lesson slides, you can switch back and forth between the activity, the slides, answer keys and other lesson materials.
A sample slide presentation is available for your review. Please log in to view all the class presentations available with your plan..
Lesson 1
Welcome
14 Slides
Lesson 2
Connect Code Blocks
34 Slides
Lesson 3
Recognize the Pattern
21 Slides
Lesson 4
Follow the Path
22 Slides
Lesson 5
Sequencing
21 Slides
Lesson 6
Conditional Logic
23 Slides
Lesson 7
Conditional Loops
24 Slides
Lesson 8
Draw Simple Shapes
27 Slides
Lesson 9
Squares, Triangles, and Staircases
20 Slides
Lesson 10
Sequencing Review
24 Slides
Lesson 11
Use Repeat Loops
25 Slides
Lesson 12
Complete Multiple Tasks in Order
24 Slides