CREATIVE COMPUTING
Green Level Student Workbook
Computer Science for All
SAN FRANCISCO UNIFIED SCHOOL DISTRICT
Using the power of computers to solve problems and express ourselves.
THINGS COMPUTER SCIENTISTS DO:
Always log in to Scratch accounts.
Keep usernames and passwords private.
Give projects a name.
Share creations and ideas with others.
Collaborate with others.
Ask for and provide feedback.
Act safely, responsibly, and respectfully online.
Give credit for images and music used in projects that were found on the Internet.
Encourage others to join in the fun!
COMPUTER SCIENCE
Steps to complete a task.
Computer scientists use an algorithm to plan out the steps they want a computer to follow. Here is an algorithm for Scratch cat:
ALGORITHM
1. Move forward 10 steps
2. Wait 2 seconds
10
2
3. Change color to green
PROGRAM
A set of instructions written in a language that a computer understands.
A computer cannot understand the same languages that people speak. We must write code, a special language that a computer understands. An algorithm written in code is called a program.
Here is a program for Scratch cat’s algorithm from above.
Can you match each step of the algorithm with each code block?
1
A script is a set of Scratch blocks connected together to form a sequence.
A set of instructions that
follow one another in order.
To create an algorithm, a computer scientist must be very precise when describing the steps to complete a task. The sequence, or order, of those steps is also very important.
This script uses the same blocks. The same actions will occur, but the outcome will not be the same because the script uses a different sequence.
SEQUENCE
When you connect blocks together in Scratch to form a script, the sprite will follow them in order, one after another.
In this script, the sprite will first move 10 steps, then say “Hello!” for 2 seconds, and lastly will play the sound “pop”.
10
1.
2.
3.
1.
1.
2.
2.
3.
3.
2
POP!
1.
2.
3.
Hello!
POP!
10
Hello!
EXPLORING SEQUENCE
What will happen first in this script? What will happen last?
Describe the sequence of everything that will happen in order from first to last.
These two scripts use the same blocks. Are they the same or different? Can you explain why?
Describe the sequence of what will happen, in order, in this script.
Be specific and include all of the information you see on each block.
3
Drag another glide block to the bottom of the script.
Then, drag the glide block to the bottom of the script.
3. Move the sprite to the last place on the stage.
2. Move the sprite to the next place on the stage.
Then, drag the go to x: y: block to the script below the “when green flag clicked” block.
1. Move the sprite to the starting place on the stage.
Use the block to start the sprite at the same place every time the green flag is clicked.
Use the block to make the sprite move to an exact location on the stage.
The x and y numbers are automatically filled in for you based on the sprite’s location.
UNLOCKING THE GLIDE BLOCK
4
Animate your name using a sequence of blocks!
NAME POEM
START HERE
THINGS TO TRY
ADD A NEW BACKDROP
5
PEER FEEDBACK
TWO STARS AND A WISH
Share two things you like about a classmate’s project.
Share one way to improve their project.
FEEDBACK SENTENCE STARTERS:
| My favorite part was __________________________. I like the way you _____________________________. I’m excited to learn how you __________________. |
| What if _______________________________________? Next time, try _________________________________. An idea I had is ________________________________. |
6
An action that causes
something to happen.
These are event blocks in Scratch. They control the action in your program. A script in Scratch should always begin with an event block.
In this script, every time the sprite is clicked, it will move 10 steps, then say “Hello!” for 2 seconds.
In this script, every time the green flag is clicked, the sound “Dance Around” will play until it is done.
EVENT
10
Hello!
7
What will happen when the green flag is clicked?
What will happen when the sprite is clicked?
What will happen when the green flag is clicked again?
EXPLORING EVENTS
How do you make the sprite say “hello”? Move 10 steps?
Play the sound “pop”?
Describe what each event will cause the sprite to do:
8
Use events in Scratch to create an interactive collage about yourself!
ABOUT ME
START HERE
THINGS TO TRY
OTHER BLOCKS TO PLAY WITH
9
Repeat a sequence of instructions.
This is a repeat loop block in Scratch.
It controls how many times something will repeat in your script.
In this script, the sound “meow” will repeat 10 times.
In this script, both actions will repeat 6 times.
Change the number next to the word “repeat” to control the number of times the blocks inside the loop will repeat.
In this script, the sprite will glide to a place on the stage before the sound “zip” repeats 4 times.
After the sound “zip” repeats 4 times, the sprite will change color.
LOOP
10
BREAKING LOOPS DOWN
This sprite will first change to the next costume, then wait 1 second. This sequence will repeat 2 times. If you break down the code in this loop, it would look like this:
11
In both scripts below, the sprite will first go to the middle of the stage, then play the sound “moo” 3 times. Last, the sprite will glide to a different place on the stage.
1
2
{
{
{
{
{
1
2
3
Computer scientists use loops to make it easier to read and write code that repeats.
Compare these two scripts that do the same thing.
Which one is easier to read? Why?
Which one would be easier to write? Why?
EXPLORING LOOPS
How many times will the sound “buzz” play?
Which two of these scripts will do the same thing?
Describe the sequence of what will happen, in order, in this script.
Be specific and include all of the information you see on each block.
How many times will the sound “hiss” play? How about the sound “pop”?
12
Use loops to combine music and animation to create a dance party!
DANCE PARTY
START HERE
THINGS TO TRY
OTHER BLOCKS TO PLAY WITH
13
Coordinating actions
between different sprites
Back-and-forth actions between two sprites can be synchronized using wait blocks to set the timing between the actions.
When you tell a joke, it is important to wait for one person to finish talking before the next person starts.
SYNCHRONIZATION
In the scripts below, Owl asks a question and Bat waits until Owl is finished to answer it.
14
EXPLORING SYNCHRONIZATION
Synchronize this conversation with the missing wait times in the scripts below.
Which sprite will speak first when the green flag is clicked?
There are bugs in this program. How would you fix the timing for this joke?
15
DO:
Be respectful.
Talk about the work.
Explain what you are doing.
Switch roles often.
Think ahead and
make suggestions.
Driver
Controls the actions of the computer.
Navigator
Helps the driver by thinking about the BIG picture and offering suggestions.
PAIR PROGRAMMING
Two programmers working collaboratively on one device.
DON’T:
Be a bossy navigator.
Grab the driver’s mouse or keyboard.
16
Use events, loops, and synchronization to tell a story in Scratch!
STORYTELLING
START HERE
THINGS TO TRY
OTHER BLOCKS TO PLAY WITH
17
EXPLORING MAKEY MAKEY
1. Plug the Makey Makey into the computer using the red USB cable.
USB cable
red light should turn on
2. Close any pop-up windows.
3. Connect yourself to EARTH
Alligator clip into “EARTH”
Hold the metal part.
TIP: Removing the cover makes the clip easier to hold!
4. Try playing Flabby Physics!
www.flabbyphysics.com
Hold the metal part of EARTH clip
Touch metal “SPACE” area
green light means it’s working!
5. Connect everyday objects!
Connect an object to the board - try metal, food, or play-doh
Hold the metal part of EARTH clip
Touch the object to complete the circuit!
18
Your computer should think the space key was pressed. If not, try pressing more firmly with your finger.
MAKEY MAKEY + MUSIC
Use the Makey Makey to create bongos or a piano, and then rock out with your classmates!
makeymakey.com/bongos
You will need 3 alligator clips to create the bongos.
Which keys will you need to connect?
makeymakey.com/piano
You will need 6 alligator clips to create the piano.
Which keys will you need to connect?
19
SCRATCH INTERFACE
Add a new sprite by clicking on the cat button in the sprite area.
A sprite is an object or character you can program in Scratch.
Here’s where you can find the important things in Scratch:
Click on these buttons to add a new backdrop or sound, too.
Explore the other options on the blue menu!
20
COMPUTER SCIENCE VOCABULARY
algorithm: steps to complete a task
computer science: using the power of computers to solve problems and express ourselves
computational thinking: thinking like a computer scientist; involves decomposition, abstraction, pattern recognition, and algorithms
copyright: a law that protects a creator’s rights and requires other people to get permission to use, copy, and share their work
Creative Commons: a copyright license that makes it easier for people to copy, share, and build on other people’s creative work, as long as they give credit to the creator
debug: find and fix errors (bugs) in programs
decomposition: breaking down a problem into smaller pieces
digital citizen: someone who acts safely, responsibly, and respectfully online
event: an action that causes something to happen
Internet: a group of computers that are connected to each other
loop: repeat a sequence of instructions
pair programming: two programmers working collaboratively on one device
parallelism: sets of instructions that run at the same time
program: a set of instructions written in a language that a computer understands
sequence: a set of instructions that follow one another in order
synchronization: coordinating actions between different sprites
How to start a new Scratch project:
DONE with your project? Check for the following:
Created by the San Francisco Unified School District (SFUSD) Computer Science team: CSinSF.org.
Adapted from resources developed by the CANON Research Lab from University of Chicago STEM Education, and the
ScratchEd team at the Harvard Graduate School of Education. Shared under a Creative Commons license (CC BY-NC-SA 4.0)