0% found this document useful (0 votes)
46 views22 pages

Lesson Presentation - Forever Loops

This document is a lesson plan focused on teaching students about forever loops in Scratch programming. It outlines the aim, success criteria, and various activities that help students understand the differences between repeat loops and forever loops, as well as their applications in coding. The lesson encourages interactive learning through questions, discussions, and practical exercises involving animations and dance routines using forever loops.

Uploaded by

a.alsinjilawi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views22 pages

Lesson Presentation - Forever Loops

This document is a lesson plan focused on teaching students about forever loops in Scratch programming. It outlines the aim, success criteria, and various activities that help students understand the differences between repeat loops and forever loops, as well as their applications in coding. The lesson encourages interactive learning through questions, discussions, and practical exercises involving animations and dance routines using forever loops.

Uploaded by

a.alsinjilawi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 22

Computing

Coding with Scratch: Learning


Loops

Computing | Coding with Scratch: Learning Loops | Forever Loops | Lesson 4


Question Marks

This is Quizby.
He is a question mark who
loves to ask questions.

When you see a question mark icon like this in


the Lesson Presentation, it can be clicked on
to reveal
one of Quizby’s questions.

The questions that appear next to these question marks


will help you to think about the key learning throughout
the lesson.
Aim
● To use a forever loop to repeat instructions continuously.

Success Criteria
● I know the difference between a repeat loop and a forever
loop.
● I know when to use a forever loop.
● I can use forever loops in algorithms for a particular purpose.
● I can explain why loops are useful.
Remember
It
Do you remember this Scratch block from last lesson?

Talk About It: Talk to your partner.


Can you remember what this block is
called? What does it do? Why is it
useful?
Remember
It
Do you remember this Scratch block from last lesson?

This white area allows us


to customise the repeat
block. We can edit the
number to change how
many times the code
inside is repeated.

Being able to customise coding blocks is very important.


It helps to keep code short and simple. Using repetition in
coding saves computer programmers a lot of time.
Remember
It
The sprites in Scratch are all in a dancing mood today.
Just look at them go!

Open Lesson 4 (Beetle Teacher Example) to see Beetle


dance. Can you spot the correct algorithm that has been used?

Not this one. Not this one.


Well done. Beetle
There is no loop Beetle does not
repeats the dance
block to repeat repeat the dance
moves 3 times.
the actions. moves 8 times.
Remember
It
Open Lesson 4 (Crab Teacher Example) to watch Crab
dance. Can you spot which of these algorithms is the correct
one?

Not this one.


Great choice! Not this one. Crab
There is no loop
Crab moves and repeats the actions
block to repeat
grows 6 times. more than 2 times.
the actions.
Remember
It
Open Lesson 4 (Cat2 Teacher Example) to watch Cat2
dance.
Can you spot which algorithm has been used?

Spot on!
Not this one.
Cat2 repeats her Not this one.
There is no loop
crazy dance There are too many
block to repeat
moves repeats.
the actions.
4 times.
The Forever
Loop
In this lesson, you will learn about another type of loop in
Scratch called a forever loop.

Talk About It: Look carefully at the two


blocks.
What do you notice is different between
Did you notice that the forever block does not include a white
them?
area where you can customise how many times to repeat the
code within it? Why do you think that is?
The Forever
Loop
A forever loop is sometimes called an infinite loop.

Do you know what the word ‘infinite’ means?

Infinite means
endless or
limitless.

A forever loop repeats the instructions inside the loop


over and over again with no end point.
The Forever
Loop
Now that we know about different types of loops, we have to
think carefully about which loop to choose when tackling a
specific problem or task.

Cat wants to teach you some dance moves. Time to get up on


your feet. Can you follow the steps and do the dance?

One step right.


Hands up.
Spin around once.
Hands down.
One step left.
The Forever
Loop
Cat thinks that the dance would be better if we repeated these
steps more than once. What could Cat include to help write the
dance instructions?

Did you think of a loop? What a good idea! A loop is a great


way to repeat the same actions continuously.
X
Why is a loop useful in
coding?
The Forever
Loop
Cat is still busy planning a dance routine for you.

Cat is thinking about the different loops to use. Which loop do


you think would be best to help Cat write the dance
instructions for you? Why? Click on each loop to find out more.
The Forever
Loop
The forever loop is good to use for sprites because they never
get tired. Computer programs can repeat endlessly without
needing to rest or sleep.

Only use the forever loop if you want an action or sequence of


actions to be repeated continuously without ending.

You could use a forever loop


to make a ball bounce
endlessly
The forever loop is a great
way to make a sprite walk.
The Forever
Loop
A forever loop is a good way to animate a sprite. Using a
forever loop can make a sprite look like it is walking or
jumping or dancing.
Can you use the blocks shown below to create an algorithm in
Scratch to make Frog 2 jump up and down continuously? Test
your algorithm to see if Frog 2 does keep jumping.

Top Tip: Remember


that Scratch uses an
x,y coordinate grid.
Changing the y
position moves a sprite
up and down.

Click on the frog to see one possible


solution.
Let’s
Dance
When you hover the cursor over some of the sprites in the
sprite library you may notice that some of them look like they
are moving.
These sprites have different Costumes. A Costume shows the
sprite in a slightly different position or colour.
Click on the Costumes tab above the Block Palette to see
the different Costumes for the sprite you have chosen.

Using Costumes and forever loops together is a fun way


to create some crazy dance moves.
Let’s
Dance
The Cassy Dancer sprite has four Costumes.
Open Lesson 4 (Let’s Dance Teacher Example) to see how
the different Costumes make Cassy Dancer look like she is
dancing.

What do you think would happen


if you changed the white area of
the wait block from 1 to 0.5?

X What would happen if wait blocks


were not included in the forever
loop?
Disco
Dancers
Now it is your turn!

Use the Disco Dancers


Activity Sheet to create
some crazy Disco Dancers
of your own.
Choose the dancer you like
most to show off their
moves.
Choose from Champ99,
Jouvi Dance, Ten80
Dance or Cassy Dancer.
Dance
Off
Remember to save your work with a filename that will let you
find it again.

Show your work in a big end of lesson dance off. Evaluate each
other’s work.

Think About:
● What works well?
● What could be improved?
● How did the forever loop help with the code?
Aim
● To use a forever loop to repeat instructions continuously.

Success Criteria
● I know the difference between a repeat loop and a forever
loop.
● I know when to use a forever loop.
● I can use forever loops in algorithms for a particular purpose.
● I can explain why loops are useful.

You might also like