An Introduction to Programming Using Scratch
Note : These materials are a rough lesson plan of a three hour activity
conducted with fourth through sixth graders. They are based on materials
Introductions and set up (15 minutes)
- Introduce facilitators
- Make sure each student has access to a computer
- login : csv
- password : Visitor2
- What is Scratch
- A visual programming environment where you can (relatively easily) make
some pretty cool game applications
Introduction to simple commands (15 minutes)
- Launch Scratch (Start - > All Programs or might even be right there from
main start menu)
- Notice that Scratch is divided up into several sections.
- The first one of interest is on the right and is called the "stage"
This is the area in which we will move the "actors" in our programs.
- Below this is a list of all of the current actors in our programs.
Notice that actors in our programs are called "sprites" and at the moment we
only have one actore
- In the Middle is a "script" / information area for our one of the
actors. At the moment this information area is empty. We will
work more with this later
- On the Left side is a list of commands that we can send to our actor
- To begin with, explore the blue commands currently in the command list.
What do they do?
- [LARGER DISCUSSION : As appropriate discuss coordinates, direction, turn
degrees, etc Notice that anything in the white "circle" can be changed.
Introduction to a sequence of commands (15 minutes)
- Sometimes we want to do several actions in a row. For example, we
might want to move forward 30 steps and then turn 45 degrees.
- Drag the appropriate blocks to the middle "scripts" area and then double
click on it to run the entire sequence.
- What happens?
- Create a sequence so that your sprite draws a square. An Octagon.
An equilateral triangle
- Use the pen to actually check what you drew
Introduction to Iteration (15 minutes)
- Notice that when you draw a square you have some repetition. A
square is four sides. For each side you go forward some distance and
then turn 90 degrees.
- Rather than repeating our code blocks four times we can use the concept of
- Drag out the repeat block and set it's value to 4
- Put a move/turn sequence inside of there.
- Click the block and see what happens (remember to have the pen down if you
want the sprite to draw a trail)
Experiment with different angles and sequences of commands to produce
Flowers are produced by drawing a simple shape and then
turning a little before repeating the shape to form a flower. The following
example is a square flower but you can experiment with triangles and hexagons
and other shapes.
The above example has a repeat iteration nested within
A forever loop combined with a random number can produce
continuous random behaviour easily.
Introduction to Conditionals (15 minutes)
Suppose that we want to make a program where we move the cat around at random
(like above, but we want to make sure that he doesn't wonder off the screen
What can you do ??
The following example (added after the wait in the previous example) causes
the sprite to think each time it reaches the edge of the stage before bouncing
Conditional statements have slots that are shaped with points on either side
which evaluate to a true or a false value and execute if the statement is true.
They are found in the controls programming blocks and are used
for program flow with if, repeat,
forever, and wait blocks. The conditional part of the
statement is found amongst the numbers and the sensing