KS2 Shapes and Crystal Flowers

KS2 Shapes and Crystal Flowers
An introduction to repetition using Scratch
Recommended Year Groups: Year 3 -6
Activity Duration: 1 hour
Concepts and approaches
Curriculum links
Computing:
• KS2: use repetition in programs
Maths:
Year 3: draw 2D shapes; recognise angles as a property of a shape or a
description of a turn
Year 4: compare and classify geometric shapes, including quadrilaterals and
triangles, based on their properties and sizes
Year 5: know angles are measured in degrees: estimate and compare acute,
obtuse and reflex angles; draw given angles, and measure them in degrees (°);
identify: angles at a point and one whole turn (total 360°)
Year 6: draw 2-D shapes using given dimensions and angles; compare and
classify geometric shapes based on their properties and sizes and find unknown
angles in any triangles, quadrilaterals, and regular polygons
Art and Design:
to develop their techniques, including their control and their use of materials,
with creativity, experimentation and an increasing awareness of different kinds of
art, craft and design
•
•
•
•
•
This activity requires pupils to explore and use angles and degrees, therefore
if working with a lower Key Stage 2 class, pupils will need to introduced to the
concept of degrees and given more support in this area.
Introduction
In this activity pupils learn about repetition (loops) by creating programs to draw
patterns made of simple shapes. They design algorithms to draw regular 2D
shapes. They write code in Scratch to draw these shapes using a repeat block.
They develop outlines of simple shapes into more complex patterns by using
nested loops. In doing so they learn how to use repetition to perform the same
command, or group of commands a number of times.
Prior knowledge
Pupils should have completed:
KS2 Tinkering with Scratch, or be familiar with how Scratch works.
KS2 Dinosaur fossil animation sequence activity, or have created basic Scratch
programs containing sequences of commands.
•
•
KS2 Shapes and Crystal Flowers
page 1/13
Pupil objectives
•I can write a program that uses a repeat command
•I can explain what the repeats do in my program
Resources
•MIT’s Scratch 1.4 or Scratch 2.0 (Please refer to this guide on the ways to
download or use our Scratch resources in your school)
•Pupil access, in pairs, to Scratch – either version 1.4 or 2.0
•An interactive whiteboard for writing up key terms, pupils’ ideas about shape and
to display Scratch as you work through this lesson
Shapes and crystal flowers teachers’ presentation (see the download link at the
bottom of this webpage).
Pupils’ whiteboards or exercise books
Printed pages from the IWB for help sheet (see differentiation) if needed
Some pupils may benefit from using a preloaded Scratch project. This contains
the code to draw a square using sequence rather than repeat and a repeat block
ready to use in the scripting area http://Scratch.mit.edu/projects/26526384/
•
•
•
•
Before you start
•Download the resources required for this activity from the list above.
•Look at the example Scratch code to familiarise yourself with how to create a
loop and nested loop shape http://scratch.mit.edu/projects/26805213/
•Print copies of the help sheets for pupils that require them (slide 2 or 3 of
presentation)
Organisation
•This activity is organised with pupils working in pairs. Each pair will need access
to a computer running Scratch. If you do not have access to a sufficient number
of computers to make this organisation possible, you may wish to group pupils in
threes or deliver this lesson with half of your class at a time.
Introduction (15 mins)
Challenge: Draw a square? (10 mins)
Explain that you would like pupils to complete a Scratch challenge. The
challenge is can they draw a square using Scratch. Pupils should work in pairs
for this challenge.
Ask pairs to quickly work out the algorithm that they think they will need,
perhaps writing this down on either whiteboards or in their exercise books.
Some pupils may need to walk a square to remind themselves of the sequence
of steps. Pupils might use arrows, letters or words. At this point tailor your
vocabulary to your class’s level of knowledge in mathematics, for example using
the words turn, right angle and/or 90 degrees as appropriate.
Open Scratch so it is visible on the interactive whiteboard and save a new
project with an appropriate file name such as shapes_misswaite_1.
According to your class’s experience, review the main areas of the Scratch
programming environment: the stage, the tabs where they can select scripts,
costumes and sounds, the scripting area where commands are snapped
together to create the code etc. This revision is perhaps best done by pupils
showing the rest of the class what they can remember. (If necessary you can
use the IWB page (slide 2), as shown below, to support you.)
•
•
•
•
KS2 Shapes and Crystal Flowers
page 2/13
This page could be printed off as a help sheet as it has the basic blocks that pupils will need to create
their shapes, as well as the block categories as shown circled.
•Pupils should now open Scratch and create a new project with an appropriate
file name saved to the school network, or the Scratch website if they have their
own accounts. Give pupils five minutes or so to use their algorithm to write their
code.
If pupils struggle to remember the commands they need, support them by
showing them the relevant blocks such as pen, move, turn and clear.
Encourage pupils to write a few lines, test their code to debug it, write a few
lines, test their code to debug it.
Once all pupils have had a go at this challenge, share their solutions and
discuss any differences. Use this discussion to lead to the next step as below.
•
•
•
Introduce repetition (5 mins)
Using pupils’ work as much as possible as the basis of your examples, share a
sequence based solution and a repeat based one (similar to the ones below). If
no pupils have used repetition, an example is shown on slide 4. Ask pupils what
the differences are. Ensure that pupils have noted that some steps are repeated
in the sequence version and that these steps have been moved inside the
repeat command on the repetition based version. Ask pupils what the number
next to the repeat is to ensure that they understand this is the number of times
loop will run.
•
Drawing a square as a linear sequence of steps and with a repeat (slide 4).
KS2 Shapes and Crystal Flowers
page 3/13
•Set the pupils a challenge: by the end of the lesson they should be able to tell
you how loops are useful. Briefly discuss their ideas now, but ask them to keep
this in mind as you will return to this at the end of the lesson (slide 5 if needed).
Main task (35 mins)
Use repetition to draw various regular polygons (10 mins)
Show the learning intention, if this is your normal practice (slide 6).
•
Adapt the learning intentions page to your school’s standard format, if you use one.
•Ask pupils to write a repeat based version of ‘draw a square’.
•Do not model how to write the repeat based version, instead allow them to find
out how to move blocks into the repeat command. Remember to remove the
display of the repeat code from the interactive whiteboard so that pupils do not
copy your version.
Support pupils if they encounter problems showing them the commands they
need e.g. repeat ( ) (where ( ) is the number of times).
As pupils complete the task of coding a square using a repeat block,challenge
pupils to write new programs, using a repeat command, to draw other regular
polygons, such as an equilateral triangle, a regular pentagon, a regular octagon.
Revise any maths knowledge as necessary.
Ask pupils to duplicate or copy their earlier code to do this, and change the
copied version, or use the same code and change it. (See Teaching Notes
on ‘How to duplicate code’). Note: If pupils copy code and change the copied
version and are using the ‘When Green Flag clicked’ command rather than just
clicking on the code to run the program they will need to remove the ‘When
Green Flag clicked’ block from their old version.
Encourage pupils to use trial and improvement (debugging) to work out the
angle they need for new shapes. Encourage pupils to use logical reasoning
when discussing how they need to increase or decrease the angle as they
increase or decrease the number of sides. Model how to look carefully at
the pattern created as they try their ideas to check whether there is a gap or
overlap. Also ask children to check if they have only drawn the sides of their
shape just once, that is they have only gone round the perimeter once. For
example ‘Repeat 5 move 10 right 90’ will produce a square, but they have an
extra loop that was not necessary.
After ten minutes or so once all pupils have had a go, ask pupils to share
•
•
•
•
•
KS2 Shapes and Crystal Flowers
page 4/13
examples of their work with another pair. Ask pupils to show the shape they
have drawn to their peers and ask them what it is and what repeat has been
used to create the shape.
As a class quickly discuss the different shapes drawn and the repeats used,
including the angles.
•
Nested loops (25 mins)
Show pupils how to create a nested repeat. Explain these have sometimes
been called crystal flowers. You could at this point discuss the role of repeating
pattern in nature or art, perhaps by looking at a small selection of flower
photographs (slides7 & 8 have some examples and see Teaching Notes on
Patterns in Art and Spiritual, Moral, Social and Cultural contexts).
Explain that a nested loop involves adding a new repeat block around the
current repeat.
Using one of your pupil’s programs that draws a regular polygon add an outer
loop. Ask pupils to predict what will happen. Model testing it. (The pattern does
not change we just drew over the top as many times as the outer loop, see
example below.
•
•
•
Just adding an outer loop results in the outline not being changed.
•Add a turn within that outer repeat (loop). Ask pupils to predict what will happen.
Model testing it. (see Teaching Notes on ‘Outer loops’ for an explanation of how
to ensure the pattern is repeated through a full outer circle, but note it is more
useful for pupils to explore the relationship between these values through trial
and improvement).
KS2 Shapes and Crystal Flowers
page 5/13
A nested loop. The extra repeat has been snapped around the repeat code that draws a square and
a turn command added within the outer loop.
The output from the nested loop code.
•Model how to add comments, describing what shape the inner loop does and
how the repeat works (right click on a block in the scripting area and click on
‘add comment’).
Adding comments helps pupils think carefully about their changes to their original code. This
encourages them to use logical reasoning to predict what the effect of their changes might be.
•Challenge pupils to use nested loops to create new patterns. Remind them to
copy existing code to create the new programs.
Ask pupils to add comments to say what the loops do. Encourage pupils to
predict what the effect their changes to their code will have on the patterns they
create.
Encourage pupils to change the angle and number of repetitions in the outer
loop to explore the emerging patterns.
•
•
KS2 Shapes and Crystal Flowers
page 6/13
•As with the regular polygons, give pupils time to have a go before using mini-
plenaries to showcase any pupils’ work where they have successfully created
different patterns.
Encourage pupils to share their ideas with the class.
As pupils finish patterns, use mini-plenaries to set or model further challenges.
For example:
• use different pen colours or pen sizes for parts of the shape (e.g. by using the pen block ‘change pen color by’)
• change the inner repeat to draw a triangle, pentagon or other regular shape
• use a generic method to calculate the angle of any regular shape (see Teaching notes ‘Generic method to calculate the angle of any shape’)
• add a ‘move’ block within the outer repeat
• (See Teaching Notes ‘More Shape Ideas’ as well as the IWB which has further examples of nested loops that can be used as challenges for the whole class or for specific pupils who are making good progress).
•
•
Plenary (5 mins)
•Ask pupils to share one of their designs with the programming pair next to them.
Ask them to show the pair just the shape and ask them to work out what the
loops are that have been used. Then they should share the program and see if
they can make any suggestions to improve the code.
As a class look at one or two interesting examples discussing the aesthetics of
the patterns. Pupils might think about the significance of shapes and symmetry
in religious or cultural symbols, for example Rangoli, Islamic or Celtic patterns,
drawing out connections with other aspects of pupils spiritual, moral, social and
cultural education.
Ask pupils to discuss why repetition is useful when we program. Guide the
discussion to the idea that you reduce the number of lines of code, and so it is
quicker to code and easier to fix. An ideal example to help this thinking is ask if
you created a Pentacontagon (50 sided shape) or chiliagon (1000 sides) How
long would it take to write the program with just a sequence? What if you wanted
to change the length of each side of your chiliagon? What if you got the angle
wrong? Pupils could consider the difference between a 1000 sided polygon and
a circle; could they program Scratch to draw a circle?
•
•
•
Plenary page. There is a mistake in the long sequence based version, this shows how easy it would
be to introduce bugs to a very long sequence of commands that are repeating the same blocks over
and and over (slide 7).
KS2 Shapes and Crystal Flowers
page 7/13
Differentiation
Support:
•Pupils who find the maths here difficult could be given the angles of the shapes
they are using and the values to use for the outer nested loops, although all
pupils can experiment with changing these values in the Scratch programs.
Some pupils might benefit from walking through the steps practically and by
drawing, e.g. through drawing the shapes with pen and paper. An alternative
approach would be to use a programmable toy such as Roamer Too or ProBot
which can be used with a pen, as these include a repeat command in their
language and allow turns through arbitrary angles.
When programming, pupils who find it difficult to remember which blocks to use
can be given sample code that does not give the answer, but is for a different
shape.
There are a number of pages of IWB that can be printed and used as helpsheets
for pupils.
A template Scratch file has been provided for those pupils which need it, this
file has the sequence based square program already coded and a repeat block
already on the scripting area.
When debugging some pupils may benefit from adult or peer support.
•
•
•
•
•
Stretch & challenge:
•For maths objectives, pupils can be asked to use a wider range of regular 2D
shapes and to calculate the angles of shapes using a generic maths calculation
360/n (where n is the number of sides, see Teaching Notes.)
Rather than using a simple, regular polygon, pupils could use rectangles,
rhombuses, parallelograms or other quadrilaterals as the base shape for their
repeating pattern.
Pupils could be asked to add a ‘move’ block to the outer loop as well as a turn,
and encouraged to explain the effect.
For computing objectives, pupils should be asked to explain how their loops
work, perhaps using comments in Scratch. Pupils can be asked to add
commands to change the colour or thickness of lines, at different points in their
shape design, explaining their reasoning of what they changed and what the
impact was. (See Teaching Notes for further examples of code.)
If working in Scratch 2, pupils could create their own blocks for drawing squares,
regular pentagons, etc.
•
•
•
•
KS2 Shapes and Crystal Flowers
page 8/13
Assessment opportunities
Area
Questions
Repeat
Where have you used a
repeat?
What does your repeat
do?
How are loops useful?
Can you predict what will
happen?
Debugging
Ideas for evidence
Pupils have correctly used repetition in their
code, for example they have coded a regular
polygon with no gap or overlap.
They have add a comment which correctly
describes repetition in their code.
When questioned they can explain how a
repeat block works in their program.
They have used nested loops and can explain
how the outer and inner loop work.
When reviewing other pupils’ patterns, they
can predict what repeat has been used and
identify it in the program.
They explain why repeats are useful in their
programs using ideas like ‘They are useful
because the program is shorter as we only
have to code the repeated steps once, so it is
also easier to change.‘
Did you have any bugs in When creating a regular polygon, pupils use
your program? How did
trial and improvement (debugging) to correct
you fix them?
their code when working out the number of
Do you have a gap or an repetitions and the angle necessary to make
overlap?
a complete shape.
Did you test your inner
loop?
Pupils can explain what problems (bugs) they
What does it do?
had and how they fixed them.
Have you repeated the
polygon enough times so When using the nested loop, pupils use a
that it creates a full rota- similar method to make a complete rotation of
tion of repeats?
the shapes.
Teaching notes
How to duplicate code
Code can be duplicated by right clicking and selecting duplicate, or it can be
copied across sprites by dragging code from the current scripting area onto
another sprites image.
Outer loops
To create a full rotation of repeated shapes make the number of repeats in the
outer loop x turn in the outer loop = 360. For example to repeat a full rotation of
shapes you might repeat 36 with a turn of 10 degrees, or a repeat 20 with a turn of
18 degrees.
Generic method to calculate the angle of any regular polygon
The notes below provide an overview of a generic method to calculate the angle
of any regular polygon. This is useful as an extension for pupils who have already
KS2 Shapes and Crystal Flowers
page 9/13
worked out the angles required for a range of shapes, perhaps through logical
reasoning and trial and improvement.
Click on the light green operators tab and select the light green divide operation
and drag it inside the turn angle. Show how you can replace 90 with a calculation
360/4. Explain that the divisor (number under the division sign) is the number of
sides of your regular shape.
Optional use an operator to calculate any regular angle.
360/ number of sides.
Ask pupils to now write the code to draw a triangle, pentagon, hexagon etc. They
can then use this as their inner loop for a wider range of flower shapes.
More shape ideas
Changing pen colour and using the generic method for calculating an angle.
Pupils can experiment with pen sizes and colours (slide 8 if needed).
KS2 Shapes and Crystal Flowers
page 10/13
Add a move command to the outer loop
Drawing a triangle 10 times (10 x36 = 360 for a full rotation of repeated shapes)
Drawing a triangle 10 times (10 x36 = 360 for a full rotation of repeated shapes)
Another example of an added move within the outer loop.
Another example of an added move within the outer loop.
The output from the code above.
KS2 Shapes and Crystal Flowers
page 11/13
Using a complex polygon as the inner shape and a change pen colour.
A nested loop with a complex shape on the inner loop and change pen colour.
The inner shape can be more clearly seen if the colour is changed on the inner loop. If the line size
was also changed then this would be even clearer, e.g. thin line, then thick line for each next shape.
Patterns in Art & Spiritual, Cultural, Social and Moral contexts
There are opportunities in this activity to develop pupils aesthetic judgement of the
patterns they have created. Pupils could look at general patterns in art, pattern in
nature or patterns in different cultures. Pattern in nature, particularly petal shapes
and the repeating pattern of these in flower heads links to the theme of crystal
flowers. A selection of flower images is provided in the presentation on slides 7
and 8.
In the plenary, pupils might reflect on the significance of shapes and symmetry in
religious or cultural symbols, for example Rangoli Islamic or Celtic patterns. This
provides an opportunity to draw out connections with aspects of pupils spiritual,
moral, social and cultural education.
Concepts and approaches
Repetition
Repetition in computing allows the same block of code to be run forever, several
times or until particular conditions are met. In this activity pupils use what is called
a count controlled loop, i.e. they use a block in their code that repeats a specified
number of times. When using a repeat we have to think about what part of our
algorithm or code needs to go inside the loop. We have to identify which part of a
sequence of instructions is repeated. In extracting this set of steps we have used
pattern, as we have noticed things that are the same.
Programming
When programming take the steps of an algorithm, in this case the simple
repetition of moving and turning to draw a polygon, and convert this into code. In
KS2 Shapes and Crystal Flowers
page 12/13
writing their code, pupils here are exploring the use of the repeat block to learn
about repetition. They are using the repeat () command where () is the number
of times the loop will occur. Pupils use logical reasoning to work out how this
command works and apply this developing knowledge as they nest loops inside
each other to create more complex repeating patterns.
Evaluation
Evaluation is about making judgements, that can help to improve something. In
this activity pupils start to explore the idea of establishing criteria for evaluating.
When comparing the patterns they created they think about which patterns they
liked and how different people had different views. They might reflect on which
pattern is the more beautiful, considering what influences our aesthetic judgments,
perhaps looking at the significance of spiritual, cultural, moral and social effects.
Debugging
Pupils could debug their code by using pen and paper to trace through the steps.
Pupils could explain their code to their partner or another pair of pupils. It can also
be useful to add a ‘wait’ command after each ‘move’, this gives pupils more time to
observe what is happening.
Algorithms
Algorithms are the sets of steps which pupils use to draw their shapes. They start
to think about algorithm design as they use a repeat rather than a long sequence
of commands, evaluating different algorithms which draw the same shape, thinking
which algorithm is the best.
Taking this further
Scratch workbook exploring shape http://scratch.ie/sites/all/themes/scratch_theme/
resources/newworkbook/Module2.pdf
Introducing variables with shape http://joeapproachesinfinity.files.wordpress.
com/2009/07/drawing-shapes-with-scratch.pdf
Digital School Houses lessons on shape http://www.resources.digitalschoolhouse.
org.uk/key-stage-1-ages-5-6/213-art-of-patterns-in-Scratch
As a DT project, you could design jewelry or artwork using the shapes created by
the repeating pattern code in this activity and print it using 3D printers.
Creating snowflakes in Scratch
Related activities
Lower KS2 fossil animation sequence activity
Upper KS2 Viking raid animation sequence activity
KS2 selection activity - coming soon!
KS2 variables activity - coming soon!
KS2 Shapes and Crystal Flowers
page 13/13