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. Two Truths & A Lie

Transcript

(light music)

Hi and welcome to day two of Google CS First Friends.

Today, you'll build a project just to see how well your friend knows you.

That's right, it's called Two Truths and a Lie.

The program is based on a game in which you say three things about yourself.

Two of those things are true and one of them is a lie.

Then, your friend has to guess which one is the lie.

Okay, so it goes like this.

Okay. One, I was born on a farm.

Okay. Two, I was on a dance team and three, I have two dogs.

Which one is the lie?

You totally don't have two dogs.

That's right.

To make the game, you will use a computer science concept called conditional statements.

Conditionals are a way for computers to make decisions.

Conditional statements are used all the time in computer science.

For example, the start up company, Code2040, helps match students who are looking for a job.

With companies that are looking for employees.

That's right and the company founders and friends, Laura Powers and Tristan Walker, use conditional statements to check if a student and a company are a good match.

If they match the program lets them know.

Otherwise, it doesn't do anything.

Because of the way they're used, conditional statements are sometimes called if else statements.

The computer checks to see if something is true.

And if it's true, the computer does an action.

Else, it does a different action.

Here's an example of a conditional statement in Scratch.

If the sprite is touching the edge of the stage.

Then, the sprite will say, yes wall.

Else, the sprite will say no wall.

You can program a conditional statement in Scratch using an if else block found in the control menu.

You'll need them for today's project.

All right, I'm ready to get started coding my two truths and a lie game.

So, let's get started.

Awesome, Jason will take you through the steps to build your project and I'll see you in the last video.

Bye guys.

Now it's your turn, open the starter project and sign in to Scratch, click remix.

Next arrow_forward
Instructions
  1. Open the starter project.
  2. Click remix.
  3. Sign in to Scratch.
Attributions
  • An Interview With CODE2040, A Non-Profit Out To Diversify Silicon Valley by Drew Olanoff (http://tctechcrunch2011.files.wordpress.com/2012/09/logo2.png?w=288&h=52) licensed under CC-BY 3.0 (http://creativecommons.org/licenses/by/3.0/)
  • "Happy Go Lucky" by Scott Holmes (http://freemusicarchive.org/music/Scott_Holmes/Music_for_TV__Film/Happy_Go_Lucky) -- Licensed by CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/)
  • "Lee farm sunset hdr 1.png" by Wally (https://commons.wikimedia.org/wiki/File:Lee_farm_sunset_hdr_1.png) -- Licensed by CC BY-SA 3.0 (https://creativecommons.org/licenses/by-sa/3.0/deed.en) -- Image scaled up, cropping edges
  • Code2040 Staff by (http://code2040.org/wp-content/uploads/2013/01/laura.jpg) licensed under CC-BY 3.0 (http://creativecommons.org/licenses/by/3.0/)
  • "Lizzie and Murray - Two dogs in a field 2.jpg" by Panyd (https://commons.wikimedia.org/wiki/File:Lizzie_and_Murray_-_Two_dogs_in_a_field_2.jpg) -- Licensed by CC BY-SA 3.0 (https://creativecommons.org/licenses/by-sa/3.0/deed.en) -- Image scaled up, cropping edges
  • Code2040 Board by (http://code2040.org/wp-content/uploads/2013/01/tristan2.png) licensed under CC-BY 3.0 (http://creativecommons.org/licenses/by/3.0/)