1, 2, 3, code ! - Cycle 1 activities - Lesson 1.5. (Optional) A route of any length: Loops

Summary

When routes become long or complex, students begin to understand the importance of simplifying a program: they discover that loops can be used to avoid repetitions.

Key ideas 

(see Conceptual scenario)

"Algorithms"

  • A program is a combination of instructions.
  • In a program, loops are used to repeat the same instruction several times. 

Equipment

For the class:

  • An avatar
  • A poster on A3 or A2 size paper with a 6x5 grid
  • Instruction cards: Handout 1, Handout 7 (previous lessons)
  • Treasure chest cards: Handout 4, Handout 5 (previous lessons)

Glossary

Loop

Duration

30 min

The teacher shows the class a new route, which is bigger than the previous ones (six columns by five lines) and without any treasure chests.

 

Starting the activity

 

         
           
           
           
         

They ask the students to create a program that will take the avatar to the "destination" square. This simple exercise is very quick. Among the students’ suggestions, the "simplest" ones are those using straight lines rather than routes with stair-stepping or detours.

Route example:

 

Although simple, this program requires numerous cards: the teacher asks the students how they might be able to shorten the program. If necessary, they can tell students that there are a lot of repetitions. Rather than using the same card several times, is there a way to show on the card that the instruction will be repeated several times? The class makes and discusses various suggestions.

We suggest writing down on the card the number of times it will be applied. This type of notation has the advantage of being compatible with the design of the loops in the Scratch Junior software, which will be used in Cycle 2.

3

This card means "Move three squares to the right"

The class uses loops to simplify the previous program, which becomes:

5 4

The class then looks to see which of the previous programs they suggested can be simplified using loops.

 

Exercise and review

The teacher shows students the same route on which they have placed treasure chests:

 

         
         
           
     
         

 

The aim is to create a program to take the avatar to the destination square while collecting all the rewards (using tests, as in the previous lesson).

Depending on students' ages, this exercise can be done in small groups or as a class.

One possible solution is:



Kindergarten class, Caroline Fayard, Paris

 

Conclusion

The class summarizes together what they learned in this lesson:

  • In a program, loops are used to repeat the same instruction several times.

 

Further study (Cycle 2)

Older students can continue working on loops, especially to help them understand that several instructions can be included in a single loop. You can ask students to write a program using the fewest instruction cards possible to reach the destination, resulting in a route such as the one that follows.

The teacher hangs up the following route:

 

         
           
           
           
           
         

 

The class begins by writing a program to describe the route. After learning about loops, the students try to apply this idea to their route. They need to figure out how to make a loop with two instruction cards. The teacher can suggest the following:

( )5

This notation is also compatible with the instructions used in the Scratch Junior language.


Kindergarten class, Caroline Fayard, Paris
“The avatar on the grid. To make our avatar move, we must give it instructions. By combining instructions, we build Programs. To shorten a program length, we can use Loops.

If the class has robots, it can continue with the next sequence. If not, wrap up this sequence with the Review lesson.

 

 


<< Lesson 1.4 Sequence I Sequence II >>
Review lesson >>

 

Project partners

Aucun résultats