Skip to content

Please update your browser

Your browser version is not supported by this site. CS First may not work properly. Learn more

1. Imagine a Conversation


Hello, and welcome to day 5 of Google CS First Friends.

Today you will imagine a text message conversation that you and your friend might have in the future.

You will also learn about an important computer science concept: procedures.

A procedure is a set of computer instructions that can be used by several different parts of a program.

To make a procedure in Scratch, you can create an entirely new block.

Once you’ve created a new block, define what it does by building a block stack and snapping it below the new block.

You can use the new block whenever you want to run this block stack.

For example, you could create a new block called "meow."

Then, you could attach a block stack that tells the sprite to play a meow sound 3 times, then move forward 5 steps.

This would make this whole list of actions happen every time you use the "meow" block in the code.

You don’t have to build the entire block stack every time.

Creating a procedure, or "new block," in Scratch lets you do more with less code!

Computer science uses procedures in lots of ways.

Any computer program that repeats a single set of instructions in more than one place probably uses procedures.

For example, check out this phone app that allows the user to virtually try on different styles of makeup.

Watch how Taylor swipes the screen to a new style of makeup.

The program identifies where her eyelids and lips are on the image.

Next, the program overlays the new makeup colors.

With each swipe, the color of the makeup changes, but the functionality of "Find Eyelids" and "Find Lips" stays the same.

To keep from repeating the same instructions over and over to make this work, a computer scientist could create an "Apply Lipstick" procedure.

Each time the user swipes, the “apply lipstick” procedure is called, and a different lipstick color is used.

The procedure lets the computer scientist save time by reusing the same stack of code multiple times.

In today's activity, you will imagine a text conversation you might have with your friend in the future.

Imagine what your lives will be like.

Will you and your friend be at the same college?

Will you share an apartment or work at the same company?

Will you have houses on the same street?

Imagine what you might text to your friend in that future world.

You can choose one of these ideas to start your story: Imagine telling your friend a piece of good news.

Or, asking your friend for some advice.

Or congratulating your friend on some success they will have in the future.

Let’s get started!

Taylor will take you through the steps to build your project, and I’ll see you in the last video.

See you! Bye, Jason!

Now, it’s your turn!

Click on the starter project on this page.

Click Remix, and name the project.

Choose a story starter or come up with your own story idea.

Return to this page, and click the green arrow to move on.

Next arrow_forward
  1. Click on the starter project on this page.
  2. Click Remix, and name the project.
  3. Choose a story starter or come up with your own story idea.
  4. Return to this page, and click the green arrow.