-
(Brina Lee - Instagram Engineer)
A function is pretty much a sequence of instructions
-
to perform a specific task.
-
Basically if you're building a car,
-
what you want the car to do is what a function is.
-
Turn right, you want to turn left,
-
you want it to drive, you want it to stop.
-
All those could be functions.
-
Now that we're back with our farmer,
-
we're going to start learning how to define functions.
-
You'll notice in your workspace
-
that there's a block that has a star in the corner.
-
This is a function definition.
-
At the top line of the block it tells us the name of the function.
-
The blocks inside of it tell us what it does.
-
This definition sits in the workspace,
-
but our farmer won't do the actions
-
inside the function, until we drag out the function block.
-
To do that, we need to click on the functions category in the menu
-
and drag out the "fill 5" function.
-
Let's put the fun back into functions!