Lesson 1 - Introduction
Lesson 1 - Introduction
LESSON 1
1
Starter
We need one volunteer who is willing to be blindfolded.
We need another volunteer to direct them around the
room.
The blindfolded person must follow the instructions
EXACTLY and must get to the “X” avoiding the sharks.
2
Objective of the lesson
Understand how flow diagrams help with the
planning of programs.
4
Script
Groups
Sprite
Stage
Script Script
Blocks Area
Script Groups
To help you find the script that
you need, they have been
grouped together and colour
coded.
For instance, all the script to do
with movement is in the motion
group, all the script to do with
how the program runs is in the
control group.
6
Adding Script
To add a script to the program you need to follow these steps:
Step 1: Select
the correct
Script group
Step 2: Select
Script block Step 3: Drag the
block into the
Script area
7
Moving the Cat
What will this do?
Turn 15 degrees
clockwise
Move 10 steps
If touching
the edge
This flow diagram includes a decision
box to see if the counter touched the
Turn 15 degrees edge – if it has then it will turn 15
clockwise degrees clockwise and if not then it
will stop moving
Stop
Iteration
Iteration in programming means repeating steps,
or instructions, over and over again. This is often called a
‘loop’.
Algorithms consist of instructions that are carried out
(performed) one after another. Sometimes an algorithm
needs to repeat certain steps until told to stop or until a
particular condition has been met.
Iteration allows algorithms to be simplified by stating that
certain steps will repeat until told otherwise. This makes
designing algorithms quicker and simpler because they
don’t need to include lots of unnecessary steps.
Getting the program to repeat
Rather than having to keep pressing the space bar (or
holding it down) it would be nice to make the programme
run automatically.
Counter = 1
Counter No
= 10?
Turn 15 degrees
Yes clockwise
This flow diagram includes
Change colour a decision box to see if the
effect by 25
counter has reached 10.
Counter + 1
Stop
Over to you…
Add a piece of code which
will do the following:
◦ When the space Bar is
pressed
◦ Repeat 3 times
◦ Make the cat say “Hello!” for 1
second
◦ Turn 15 degrees anticlockwise
New Project
Start a new project
Delete the Cat sprite
by right-clicking on
the cat and selecting
Delete.
Change the sprite by using the New Sprite button.
New sprite
button
Change the Sprite
Select the Beachball sprite.
Add some code for the following:
◦ When the green flag is clicked
◦ Move 10 spaces
Stop
Change the code
What will this code do?
Move 10 steps
Once the green flag is clicked the ball will
carry on moving, even if that means it moves
off the edge of the screen.
Stopping the ball moving off the screen
Change your code to the
following:
Move 10 steps
Is it
touching No Now this has a decision box
the edge?
to find out if it is touching
Yes the edge and if it is, it will
Turn away from move away from the edge.
edge
Over to you…
Start