< Return to Video

Minecraft - Hour of Code - REPEAT LOOPS

  • 0:00 - 0:07
    I'm Lydia Winters, Mojang's brand director and we made a little game called Minecraft.
  • 0:07 - 0:12
    My favorite thing to do in Minecraft is explore. I love adventuring in caves and seeing what
  • 0:12 - 0:18
    I can find. As someone who isn't a programmer, I'm really excited to go through the Minecraft
  • 0:18 - 0:25
    lessons and actually learn some coding myself.
  • 0:25 - 0:30
    The last level needed lots of \"move forward\" blocks. It would be easier if we could just tell the computer to perform the move forward
  • 0:30 - 0:36
    command four or five times. Luckily for us, computers are really good at repeating commands
  • 0:36 - 0:43
    with repeat loops. When building Minecraft, we use repeat loops to place all the initial
  • 0:43 - 0:49
    materials for creating a new world. That's thousands and thousands of blocks. We also
  • 0:49 - 0:55
    use loops in little ways, for example to make Alex's feet move back and forth as she walks.
  • 0:55 - 1:01
    Repeat loops are a powerful part of programming.
  • 1:01 - 1:06
    Night is coming so in the next couple of levels, we're going to build a house to stay safe. We're going to use the repeat block to do
  • 1:06 - 1:13
    this very easily. To build a wall of our house, we can either tell Alex to move forward and
  • 1:13 - 1:18
    place planks four times or we can tell her to move forward and place one plank, then
  • 1:18 - 1:24
    take this command and use the repeat block to have her perform the action multiple times.
  • 1:24 - 1:28
    Now we'll click on the repeat block and tell her how many times we want her to perform
  • 1:28 - 1:32
    this action. Now let's build our house before night falls! Have fun.
Title:
Minecraft - Hour of Code - REPEAT LOOPS
Description:

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

English, British subtitles

Revisions