## ← Course 3 - Bee Functions explained by Chris Bosh

• 1 Follower
• 16 Lines

### Get Embed Code x Embed video Use the following code to embed this video. See our usage guide for more details on embedding. Paste this in your document somewhere (closest to the closing body tag is preferable): ```<script type="text/javascript" src='https://amara.org/embedder-iframe'></script> ``` Paste this inside your HTML body, where you want to include the widget: ```<div class="amara-embed" data-url="http://www.youtube.com/watch?v=xjrDRrxWvoc" data-team="null"></div> ``` 5 Languages

Showing Revision 1 created 02/27/2017 by 奕德 余.

1. One of the most important concepts in computer
science is how to define new commands, how
Most computer languages have only about one
3. hundred words or commands. The art and magic
is in defining your own new words out of these
4. building blocks. We do this all the time in
sports. For example, in basketball, you start
5. by learning how to dribble, how to do a lay-up,
how to rebound. Once you've learned these
6. really basic moves, you learn new moves and
put together these building blocks, like a
7. pick and roll or give and go. You can then
go from there to do more complex plays. Once
8. you learn that play and give it a name, everybody
on the team knows how to do it. Similarly
9. once you've taught a computer how to do an
action once using these sequences of commands,
10. you can make up your own name for that action
so it's easy to repeat it later. When you
11. define your own command and give it a name,
that's called a function. Now we're going
12. to use functions to help the bee. In this
example, our function is called get 2 nectar,
13. this green block right here. We know what
get 2 nectar does by looking at this grey
14. box which is the function definition. If we
look inside there, the get 2 nectar is going
15. to get nectar and then get nectar again. Always
look at what's inside the grey box so that
16. you know what these green function blocks
can do.