< Return to Video

Brina Lee teaches Functions

  • 0:01 - 0:04
    (Brina Lee - Instagram Engineer)
    A function is pretty much a sequence of instructions
  • 0:04 - 0:06
    to perform a specific task.
  • 0:06 - 0:08
    Basically if you're building a car,
  • 0:08 - 0:11
    what you want the car to do is what a function is.
  • 0:11 - 0:13
    Turn right, you want to turn left,
  • 0:13 - 0:15
    you want it to drive, you want it to stop.
  • 0:15 - 0:17
    All those could be functions.
  • 0:17 - 0:18
    Now that we're back with our farmer,
  • 0:18 - 0:21
    we're going to start learning how to define functions.
  • 0:21 - 0:22
    You'll notice in your workspace
  • 0:22 - 0:25
    that there's a block that has a star in the corner.
  • 0:25 - 0:27
    This is a function definition.
  • 0:27 - 0:30
    At the top line of the block it tells us the name of the function.
  • 0:30 - 0:33
    The blocks inside of it tell us what it does.
  • 0:33 - 0:35
    This definition sits in the workspace,
  • 0:35 - 0:37
    but our farmer won't do the actions
  • 0:37 - 0:40
    inside the function, until we drag out the function block.
  • 0:40 - 0:44
    To do that, we need to click on the functions category in the menu
  • 0:44 - 0:46
    and drag out the "fill 5" function.
  • 0:46 - 0:49
    Let's put the fun back into functions!
Title:
Brina Lee teaches Functions
Description:

more » « less
Video Language:
English, British
Duration:
0:52

English subtitles

Revisions