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