Introduction v1.1

Download Report

Transcript Introduction v1.1

Section 1
Introduction
National 4/5
Scratch Course
What you should know after this
lesson
• What is a program
• Who writes programs
• Why is sequence important in programs
Programming
• A program is a list of instructions that tell
the computer what to do.
• A programmer writes the programs
• A user uses the programs
• Scripts are small programs
You will be both programmer and user in this
topic.
What is Scratch
• Scratch is a programming language and
environment that was developed by MIT to
help new programmers learn to program
quickly.
It has been designed to be used by
programmers from nursery to adult.
Getting Started
Moving the cat
Launch Scratch
• We want to move the cat forward 100 steps so
we drag the move block to the script area.
• Change the 10 to 100
• What happens when you double click it?
Turning the Cat
• We want the cat to turn to the right.
• Drag the turn clockwise block to the script
are and attach it to the bottom of the
previous block.
• Change the 15 to 90 and double click it
This is how we join the program blocks
together, you can unsnap a single or
bunch of blocks by dragging them.
Drawing
• If we keep double clicking on the blocks
you should notice the cat moves in a
circular fashion.
• Drag the “pen down” block from the pen
tab, to the top of the program
What happens when you keep double
clicking it?
Drawing a square
• I don’t want to double click the block every
time to draw a side of the square, I would
rather double click it once and have it draw
the square for me.
• How can I change the program to make
this happen?
Hint on next page
Drawing a Square
Tasks
• Create a program to draw a square.
• Copy the diagram from the previous slide
into your jotter.
• Write the program to draw a square into
your jotter.
Adding a new Sprite
• Sometimes it is nice to have more than
one sprite on the screen.
• Get a new surprise sprite
• Write a program to draw a triangle using
the new sprite.
• Hint: the angle is 120
All at once
• Wouldn’t be easier if there was a start
button?
• Well there is go to the control tab and drag
“when flag clicked” to the top of each of
your sprite’s program.
• Now when you click on the flag (top right)
your program will run
Review Question
Write the question & answers in your jotter
1. What is a program?
2. Who writes programs?
3. Why is sequence important in programs?
Extension Tasks
Modify your program to draw the following
shapes
1.
2.
3.
4.
A hexagon
A pentagon
A circle
A star