Programming 1A

A puzzle-based introduction to coding concepts for beginners where they learn sequencing, pattern recognition, loops, and conditional logic. Request Quote

Course Summary
  • Grades 1 - 2
  • Beginner level
  • 12 lessons
  • Tynker Blocks
    • Web
Course Includes
  • 12 lessons
  • 62 activities
  • Enhanced Creativity Tools
  • Automatic Assessment
  • Tutorials and Reviews
  • Coding Puzzles
  • Answer Keys
Prerequisites
No previous coding experience required.

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.

New Code Blocks

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

Vocabulary

  • None

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. Say, “Today we are going to use a combination of loops and conditions."
2. Ask, “Who can remind us what a repeat loop does?” (repeats an action over and over)
3. 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.
4. Act out the two statements. As a class, identify if the statement is an example of a "repeat while" or a "repeat until" loop.
5. Ask, “What keeps repeating over and over in these two statements?” (walking forward).
6. Ask, “What needs to happen to stop me from walking forward?” (need to reach an obstacle).
7. Encourage students to work with a partner and think of another example of a “repeat while” loop and a “repeat until” loop. Discuss.

Getting Started (20 minutes)

As a class, solve "Module 3: Turn to the Left."
1. Open "Module 3: Turn to the Left."
2. Ask your students: What is the spaceship trying to reach? (the power cell), What are two examples of a condition? (turn left and move forward), What are two conditions the spaceship needs to do to reach the power cell? (move forward and turn left)
3. Have students work together to try and solve the puzzle using only “forward” and “turn left” code blocks.
4. Once students are done, think out loud through the solution: forward - forward - turn left - forward- forward- forward- forward- forward.
5. Say, “We are now going to solve the puzzle using the ‘repeat until’ and ‘if’ code blocks.”
6. Remind students the "repeat until" block makes the spaceship repeat all blocks inside of it until it reaches the power cell.
7. Explain this is why the “if,” “turn left,” and “forward” blocks need to go inside the “repeat until” code block.
8. Place the “repeat until” code block under the start block.
9. Place the “if” code block inside the “repeat until” block.
10. Ask, “If our path goes left, then do we want our spaceship to turn left or move forward?” (turn left)
11. Place the “turn left” block inside the “if” statement.
12. Ask, “If our spaceship is not turning left, then what do we want it to do?” (move forward)
13. Place the “forward” block below the “if” code block.
14. Explain why the “forward” block needs to go below the “if” code block and not inside of it.
15. Click the play button to test your program.

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.

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