How to use the
Learning Portal

Learning Portal

Our hands-on, comprehensive lesson plans span a range of levels. Browse our free STEM and coding learning resources.

Marty Image

1.5 – Introduction to Loops

45 Minutes

Lesson Overview

In this lesson, students will continue to build upon their programming knowledge with the introduction of loops. Students should be able to understand that they can use loops to reduce the number of lines of code that they have to write by the end of the lesson through using a combination of computational thinking and the Scratch editor.

Key vocabulary:
    Code blocks , Loops , Repetition , Shapes , Patterns , Angles,

Content Sections

  • Learning Objectives
  • Extensions & Challenges
    • Additional Reading
    • 1.5 – Introduction to Loops

      45 Minutes

      Lesson Overview

      In this lesson, students will continue to build upon their programming knowledge with the introduction of loops. Students should be able to understand that they can use loops to reduce the number of lines of code that they have to write by the end of the lesson through using a combination of computational thinking and the Scratch editor.

      Key vocabulary:
        Code blocks , Loops , Repetition , Shapes , Patterns , Angles,
      • Lessons 1.1-1.4
      • Laptop, PC or Tablet
        • Marty the Robot
        • Marty Workbook (Lesson 1)
        • Paper/Pencils/Tape
        • Laptops/Computers/Tablets
        • Access to the Scratch editor

      Learning Objectives

      • Put together several lines of code blocks to get Marty to walk around in a specific shape
      • Understand that we can reduce the number of blocks by using something called loops
      • Using loop, write code blocks to get Marty to walk around in a specific shape

      1. Get students to split up into groups of 2-3 and ask each student to take a turn at pretending to be a robot whilst the other members in the team give their ‘robot’ instructions to walk around different shapes (using the tape or paper and pencils to draw out the shape to help with navigation)

      a. Remind students that there are only certain instructions that have been listed in their workbooks

      b. Start off with something simple like a square and gradually build up to something more tricky like a triangle

      2. Staying in the same groups, set up the Scratch editor connected to a Marty device and ask students to program Marty to walk around in a square

      3. Ask students to point out any patterns that they can see in their blocks of code

      4. Introduce loops as a way to repeat blocks of code n times and get students to use this to re-program Marty to walk in a square

      5. Now get students to think up some different shapes and see if they can program Marty to walk in that shape using a loop

      a. It might help students to draw out the shape and label the different angles that they will need to program that shape

      Extensions & Support

      • Students could design their own shape, draw it out and then program Marty to walk around in this shape and then challenge other student groups to try and program that shape

      Additional Reading

      • Educator’s Guide
      • Introduction to Programming with Marty using Scratch