Lesson 5: Introducing the Iterative Loop
Operational Goals
The student:
- determines directions and establishes the position of the robot in relation to oneself, as well as in relation to other objects, distinguishes the left and right side, up, down,
- arranges a sequence of instructions for the robot using directional arrow blocks,
- reads the sequence of instructions written using directional arrow blocks,
- avoids obstacles in the form of maze walls,
- extracts a constantly repeated sequence in a long sequence of instructions (new goal),
- arranges a sequence of instructions, using an iterative loop (new goal).
Brief Description
Using simple exercises in the Go Lumi! app, students will create sequential algorithms with an iterative loop to move the robot on an interactive board. They will guide the robot in the maze from the Start field to the Finish field. To do this, students will set the appropriate blocks with instructions on the interactive board in one string of characters - thus creating a sequence of instructions for the robot.
Exercise Goals
During this lesson, students will develop programming skills with an iterative loop and debugging to reach the end of the maze. They will understand the benefits of using loop structure, instead of manually repeating the same instructions. They will learn to extract a constantly repeated sequence in a long sequence of instructions. The block-based form of instructions helps students to know and understand the sequence, the idea of an iterative loop, and building and simplifying the program code without worrying about perfecting the syntax.
Lesson Plan
Duration: 45 min
Warm-up
Duration: 15 min
Choose one of the following games.
Game: I am a robot
Game dedicated for older students.
Group exercise. A selected person is a robot that performs simple commands of one of the people. The basic rule in the exercise is to apply the same command several times in a row.
After the last execution of the command:
Ask: Would it be easier for you to just ask our colleague to perform this action several times?
Encourage to think: We want the colleague to perform the action ten times. How would you change your instruction so that you don't have to repeat the same command so often? Write your instructions on cards.
Share ideas: Ask several students to share instructions with the class, indicating how each solution simplified the approach to issuing commands.
Summarize: Today we will work on finding ways to make it easier to issue many instructions, especially when these instructions are often repeated.
Game: Looped Coders
Game dedicated for younger children.
If the Looped Coders or Build Connections app is installed on the interactive floor, you can use it to let children learn the idea of an iterative loop while playing. In this game, you need to make a certain number of moves - stomps, to connect two Coders.
If you do not have such an interactive application, perform a similar exercise on the floor. Pairs of children stand opposite each other at different distances. One child from the pair repeats the command: take a step, and the other only takes one step towards the first. The person who takes the steps counts them aloud. The command is repeated until the child reaches the colleague from the pair. Children say how many steps they have taken and return to the initial setting. Then ask the student to give his colleague only one command instead of several, in which he will tell him how many steps to take. The second child from the pair executes the command.
Ask: Was it easier for you to ask your colleague once to take several steps, instead of telling him each time what to do?
Summarize: Today we will learn ways to make it easier to give many of the same instructions, so you don't have to write them all out.
New Concepts
- Loop
- The action of doing something in a circle
- Repetition
- Do something again
- Iteration
- Repeating
- Iterative Loop
- Repeating something a set number of times
Main Exercises
Duration: 25 min
Go Lumi! Level 41 - 50
Exercises in the Go Lumi! app dedicated to lesson no. 2: Level 41 - Level 50.
Choose the simplest board appropriate for the lesson topic - Level 51 - and demonstrate the principle of working in the application with the help of students. Solve the first board together.
When running the program code, call Go + the name of your robot!
Choose a convenient way to work with the group on the interactive floor:
- Divide students into teams or pairs that will solve individual boards.
- All teams can work in parallel, designing a sequence of instructions for the robot on a piece of paper or using self-prepared cardboard blocks. The selected team transcribes or arranges the code on the board.
- Check all or selected team solutions on the interactive floor together.
- Choose a person who will mimic the robot and perform commands according to the designed sequences, moving in the maze on the board. Then run the code and compare the results. If they differ, look for where the error crept in.
- Follow the course of the robot's movement in the maze and compare it with your code on the board or on the sheet. In case of incorrect behavior of the robot in the maze or a different course of driving than in the sequences of student instructions, look for the cause in the code-sequence.
- Match the next levels of boards to the students' skills.
Hint
Not all boards from a given lesson need to be completed during the lesson. Solving two boards in a lesson can also be sufficient. Adjust the pace of work to the needs of the students.Summary
Duration: 5 min
Ask students to draw or write about what they learned during the lesson and what emotions accompanied them during the exercises. They can also write down their questions.
Extended Teaching
If necessary, define homework for those interested, e.g. Think about and answer the question: In what situations in everyday life do we encounter a loop?
Preparation for Classes
- Make sure that students have a pencil or pen, a notebook or notepad in which they can write notes, thoughts, draw.
- If you plan to use additional work cards or other materials during the classes, make sure you have enough of them for the students.
- If you plan to conduct a discussion, prepare additional questions.
- Review the exercises before the lesson to identify potential problematic areas for your students.