Return to Video

Frozen - Hour of Code Introduction to Loops

  • 0:00 - 0:03
    Computers are really good at repeating actions.
  • 0:03 - 0:08
    You can count to ten, or twenty or one hundred...
  • 0:08 - 0:11
    But a computer can count to a billion or even a trillion.
  • 0:11 - 0:15
    It won't get bored and it will only take a few seconds.
  • 0:16 - 0:22
    Whether it's counting or drawing or anything,
    Computers can repeat things hundreds or even billions of times.
  • 0:22 - 0:26
    In programming, we call this a loop.
  • 0:26 - 0:30
    A loop is how you repeat your code over and over again.
  • 0:30 - 0:36
    For the next puzzle,
    your goal is to help Anna to create a square with the repeat block.
  • 0:36 - 0:43
    Any blocks of code you put inside a repeat block,
    will be repeated in sequence, as many times as you want.
  • 0:43 - 0:48
    To draw a square, you can use the "move forward" and "turn" block 4 times.
  • 0:48 - 0:59
    The easier way is to tell the computer to move forward and turn by 90 degrees once
    and then tell the computer to repeat these actions four times.
  • 0:59 - 1:04
    To do that, you need to place the move forward and turn right in a repeat block.
  • 1:04 - 1:12
    Remember, you can change the number in the repeat-block to anything, and it will repeat the actions in the block that many times.
  • 1:12 - 1:17
    [ Anna draws a square with her Foot ]
Title:
Frozen - Hour of Code Introduction to Loops
Description:

more » « less
Video Language:
Vietnamese
Team:
Code.org
Project:
Hour of Code
Duration:
01:17

English subtitles

Revisions Compare revisions