< Return to Video

Minecraft - Hour of Code: If Statements

  • 0:00 - 0:06
    Now we're going to learn about if statements.
    If statements are a fundamental part of learning
  • 0:06 - 0:13
    to program. They help a computer make decisions.
    All computers use if statements, including
  • 0:13 - 0:19
    my phone. For example, when I unlock my phone,
    it runs some code that says if I enter the
  • 0:19 - 0:26
    password correctly, then unlock the phone.
    Otherwise, it shows an error message.
  • 0:26 - 0:31
    You can use if statements in your code to make
    Steve and Alice react to what they see in
  • 0:31 - 0:38
    the world. For example, if there is a rock
    in front of them, they can turn left. Or turn
  • 0:38 - 0:46
    right if they run into a tree. In this case,
    we don't want to fall in the lava.
  • 0:46 - 0:51
    It's easy to plan for the lava. We can see it on
    the screen. But what about the lava that we
  • 0:51 - 0:55
    can't under the stone?
    After we mine the stone, we'll need to check
  • 0:55 - 1:02
    if there's any lava in that place before moving
    forward. If there is lava there, we want to
  • 1:02 - 1:09
    place a stone in front of our character before
    we move forward. That way we can safely move on.
  • 1:09 - 1:16
    Time for more mining! And remember to
    use the if statement to watch your step.
Title:
Minecraft - Hour of Code: If Statements
Description:

Xbox Engineer Jasmine Lawrence introduces you to IF statements - the piece of code that allows a computer to determine what to do if certain conditions are met. You will use IF statements to make sure Steve or Alex stay safe when moving around the Minecraft world.

Start learning at http://code.org/

Stay in touch with us!
• on Twitter https://twitter.com/codeorg
• on Facebook https://www.facebook.com/Code.org
• on Instagram https://instagram.com/codeorg
• on Tumblr https://blog.code.org
• on LinkedIn https://www.linkedin.com/company/code-org
• on Google+ https://google.com/+codeorg

more » « less
Video Language:
English
Team:
Code.org
Project:
CSF '21-'22
Duration:
01:18

English subtitles

Revisions