Professional Documents
Culture Documents
02 Spheros Shapes
02 Spheros Shapes
Robotics: Spheros
Lesson 2: Shapes and Loops
You will need:
Task 1: Using the tape draw a square on the floor. Masking tape
Create a program to make sphero to trace a square on the floor using the
roll and delay blocks, and think about the four heading angles you will
need.
Task 2: Now try to trace a triangle, and think about the three heading angles you will need.
Evidence
Task 3: Now let us refactor your code so that it draws a square using a loop.
Refactor is a common term used by developers that means to improve the way your code is written
while still making sure it performs that same action.
Evidence
Planning
What are the four colours you propose to use?
I would use red green and yellow
Question
How do loops make it easier to create a shape with five sides, ten sides, or even 100 sides?
Because if all lengths are equal you could use only a few variables which wouldhhb
Reflection Time
Discussion: Discuss the following questions with your partner:
What is a loop?
What are the benefits of refactoring your code to use a loop?
Are there actions you repeat every day? If you could program these actions, how would you write a
loop to repeat them for you?
A loop is a function that can enable your program to replay forever without
stopping.For example in everyday life, you are always breathing therefore if I
were to program someone breathing in a loop and the functions I would usE
would be ‘ inhale’ then ‘ exhale’ and I could loop these actions allowing a
continuous breathing which can create a use In everyday life.