0% found this document useful (0 votes)
17 views11 pages

Scratch3_Workbook_2019_Module_2

Uploaded by

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

Scratch3_Workbook_2019_Module_2

Uploaded by

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

Module 2

Drawing Shapes
and Repeating
Think Like a Computer 24
Exercises 25
Could You Repeat That Please? 28
Exercises 29
Over and Over Again 30
Exercises 31
End of Module Quiz 32

© 2019 Lero
Think Like a Computer

In Module 1 you learned about algorithms. Algorithms are sets of instructions that solve a problem.

We also learned that humans can interpret instructions in a different way to computers.

Computers work by following lists of instructions, and they do exactly what the instructions say, even if
they are incorrect or nonsensical!!

Go through
the door
please

Go through
the door
please

Try out some exercises that will help you understand how to think like a computer by creating
algorithms. You will execute the algorithms to test how well they work and make any modifications that
are needed to improve the algorithm.

24 | Scratch Workbook
Exercises

Describe how to draw this picture above using written instructions only in the box below.

Read out your instructions to a friend who can’t see the picture. Check how closely the picture
drawn by your friend matches the picture above.

Module 2 | 25

Describe how to draw this picture above using written instructions only in the box below. You
should make some improvements based on your experience from exercise 1.

Read out your instructions to a friend who can’t see the picture. Check how closely the picture
drawn by your friend matches the picture above. Were there any improvements made from
exercise 1?

26 | Scratch Workbook
 Follow the instructions in this algorithm to draw something in the first box below.

1. Draw a rectangle.
2. From the centre of the rectangle’s uppermost longer side, draw a straight line upwards
perpendicular to the rectangle. This straight line should be the same length as the
longer side of the rectangle.
3. Draw a right-angled triangle on the right hand-side of the perpendicular line.
4. Draw another triangle on the left hand-side of the perpendicular line. This triangle
should be a mirror image of the triangle drawn in step 3.
5. On the top of the page, draw three stars.

Does your picture match the one from the solutions section?

Write a new version of the algorithm including improvements in the box below.

Module 2 | 27
Could You Repeat That Please?

A computer can perform repetitive tasks efficiently. The code written below in Scratch will draw a square.
In the script a loop will repeat the steps of drawing each side of the square and rotate to draw the next
side of the square.

This hides the sprite


before drawing of
the square begins

This clears the


stage

The pick random


This lifts the pen command sets the
colour of the pen for
drawing the square to
any random number
between 1 and 100.
1 = red colour and
This lowers the 100 = blue colour.
This tells you at
pen so drawing can
what position
begin
on the stage the
drawing will start.

This is the repeat


loop that draws the
square

28 | Scratch Workbook
Exercises

 In the box provided, explain what each line of code does. What does this code draw?

 Use Scratch to write the script. Does it match what you have described in the box?

Use Scratch to draw a circle and pentagon side by side on the stage as shown in the image below.

Module 2 | 29
Over and Over Again

We learned in the previous section that a loop can be used by computers to perform repetitive tasks
efficiently.
Use Scratch to write the script below to draw 4 different shapes 5 times. It uses a loop inside a loop also
known as a nested loop.

This loop repeats


all the instructions
** inside it so that the
shapes are drawn 5
times

These repeat loops


draw a triangle,
a pentagon, a
hexagon, and a
circle

**

**
**Note that the pen up
command is used before
the x/y position changed so
that the pen can move to a
new location before drawing
again.

**

This changes the


x and y value so
that the set of 5
** shapes are drawn in
a different location
This changes the
each time
colour of the pen
so that each set of
shapes is drawn in
a different random
colour.

30 | Scratch Workbook
Exercises

 Use Scratch to draw the shape on the stage as shown in the image below.

Hint: You can draw this shape by using a loop to draw 4 sides of a square, inside a loop to draw 4
squares, contained in a loop to draw the 4 square patterns twice.

Draw 4 shape pattern 2 times

Draw squares 4 times

Draw 4 lines to make a square

 Use Scratch to draw the shape on the stage as shown in the image below.

Module 2 | 31
End of Module Quiz

 Identify the shape that is described by this algorithm. “Put your pen on paper. Face right . Move
2cm. Face up. Move 0.5cm. Rotate right by 135 degrees. Move 1 cm. Rotate right by 90 degrees.
Move 1 cm. Face up. Move 0.5cm. Face left. Move 2cm. Face up. Move 0.45cm.”

 Which of the items listed below is not a good reason for software testing?

A. It helps you find bugs in your program.


B. To make sure your program does what you expect.
C. It helps to see if other people can understand and use your program easily.
D. It helps you to find new costumes for a sprite.

 What does this script do?

A. It draws a Square
B. It draws a Hexagon
C. It draws a Triangle
D. It draws a Circle

32 | Scratch Workbook
 Which one of these loops will draw a circle?

A.

B.

C.

D.

Module 2 | 33

You might also like