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 Logic

Time: 85+ mins

Introduction

Students use loops and pattern recognition to help Gus the astronaut jump over obstacles. In "Module 3: Using Conditions," students are introduced to “if” statements.

New Code Blocks

  • : If the condition is true, then run the code inside the block.

  • : If the condition is true, then run the code inside the "if" case.
    Otherwise, run the code inside the "else" case.

Vocabulary

  • Condition: A logical expression that evaluates to true or false
  • Conditional loop: A loop that performs an action if a certain condition is met

Objectives

Students will...
  • Identify conditions
  • Solve puzzles using conditional logic and loops

Materials

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

Warm-Up (25 minutes)

1. Draw this chart on the classroom board:

2. Ask, “If you hear the fire alarm, then what should you do?” (line up at the front of the door). Say, “Correct! If you hear a fire alarm, then line up at the front of the door.” Write down the answer underneath the “then” column.
3. Ask “If you have a question in class, then what should you do?” (raise your hand). Say, “Correct! If you have a question in class, then you raise your hand. "Write down the answer underneath the “then” column.
4. Add more rows and fill in the chart with more everyday examples:
  • If your shoelace is untied, then what do you do? (tie your shoe)
  • If you need to sharpen your pencil, then what do you do? (use a pencil sharpener)
  • If you fall on your knee and get a bad scrape, then what do you do? (tell the teacher)
5. Continue connecting conditions and responses with arrows.
6. Explain that we’ve been creating if statements. An if statement tells us what to do if something [a condition] is true. For example, “If you hear the fire alarm, then line up” is a conditional statement.
7. Say, “Computers need to be programmed, or told, to act this way. We program computers to react to things using ‘if’ statements.”
8. Encourage students to work with a partner and think of more “if” statement examples. Discuss.

Getting Started (20 minutes)

As a class, solve "Module 5: Do It In a Loop"
1. Open "Module 5: Do It In a Loop."
2. Ask your students: What is Gus trying to reach? (the power cell), What are two conditions Gus needs to do to reach the power cell? (walk and jump), What are some obstacles in his way? (aliens)
3. Have students work in pairs to try and solve the puzzle using only “walk” and “jump” code blocks.
4. Once students are done, think out loud through the solution: jump - walk - walk - jump - jump - walk.
5. Say, “We are now going to solve the puzzle using the ‘repeat until’ and ‘if-else’ code blocks.”
6. Remind students the “repeat until” block makes Gus repeat all blocks inside of it until he reaches the power cell. Explain this is why the “if-else,” “jump,” and “walk,” code blocks need to go inside of the “repeat until” block.
7. Place the “repeat until” code block under the start block.
8. Place the “if-else” code block inside the “repeat until” block.
9. Ask, “If there is an alien in front of Gus, what do we want him to do?” (jump)
10. Ask, “If there is not an alien in front of Gus, what do we want him to do? (walk)
11. Place one “jump” block inside the “if” case.
12. Place one “walk” block inside the “else” case.
13. Click the play button to test your program.

Activities (40 minutes)

1. Detect the Pattern (Puzzle)
  • Students can solve this puzzle by placing the “jump” and “walk” blocks three times, but encourage them to use the “repeat” block.
  • Give a hint: Tell students that two blocks go inside the “repeat” block.
2. Two Loops (Puzzle)
  • In this puzzle, students have the opportunity to discover various creative solutions. If students quickly find one solution, challenge them to create a different solution using two “repeat” blocks or a different sequence of steps.
3. Using Conditions (Puzzle)
  • This puzzle introduces the “if” block, which tells Gus to check the space in front of him, and what to do if there is an alien.
  • Remind students of today’s warm-up activity. Say, “Gus needs instructions that tell him to react to what he sees, and we can do that by using the ‘if’ code block.”
4. The Else Block (Puzzle)
  • This puzzle introduces the “if-else” block, which has two separate possible outcomes.
  • Explain that “else” is another way of saying “otherwise.”
5. Do It In a Loop (Puzzle)
  • This puzzle brings back the “repeat until” block, which was introduced in Lesson 3. Remind students that “repeat until” makes Gus repeat all blocks inside of it until he reaches the power cell.
  • Students can solve this puzzle by placing only “walk” and “jump” blocks, but encourage them use a “repeat” and “if-else” code block.
6. Until Gus Reaches the Goal (Puzzle)
  • The solution is the same as the previous puzzle, but this puzzle includes different obstacles.

Optional Activities (20 minutes each)

Conditional Logic Practice
Draw this chart on the classroom board. As a class, fill in the blanks. Encourage students to act out the sentence as you say it out loud.



Review
Discuss with students:
  • What was the most challenging puzzle for you?
  • Who can give me an example of an “if” statement? Who can give me an example of an “if-else” statement?
  • What’s the difference between “if” and “if-else” statements?

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, 1.OA.B.3, 2.OA.B.2
CSTA: 1A-AP-08, 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
ISTE: 1.c, 1.d, 4.d, 5.c, 5.d, 7.c