1 00:00:00,000 --> 00:00:02,840 One of the most important concepts of computer science, 2 00:00:02,840 --> 00:00:07,230 is how to define new commands; how to add your own words to the computer language. 3 00:00:08,571 --> 00:00:13,072 Most computer languages have only about a hundred words or commands 4 00:00:13,072 --> 00:00:18,252 and the art is to define your own new words out of these coding blocks. 5 00:00:18,252 --> 00:00:20,200 We do this all the time at sports. 6 00:00:21,922 --> 00:00:26,930 In basketball you learn how to dribble, how to do a lay-up and how to rebound. 7 00:00:26,930 --> 00:00:30,911 Once you've learned these moves, you learn new moves 8 00:00:30,911 --> 00:00:34,714 and put together these building blocks, like a pick and roll or give and go 9 00:00:34,714 --> 00:00:37,503 and from there you can do more complex plays. 10 00:00:37,503 --> 00:00:43,201 Once you learned that play and give it a name, everybody on the team knows how to do it. 11 00:00:43,201 --> 00:00:47,344 Simulary, once you learned a computer how to do an action once, 12 00:00:47,344 --> 00:00:49,086 using these sequence of commands, 13 00:00:49,086 --> 00:00:53,721 you can make up your own name for that action, so it's easier to repeat it later. 14 00:00:53,721 --> 00:00:58,273 When you define your own command and give it a name, it's called a function. 15 00:00:59,613 --> 00:01:00,868 If you are programming with blocks, 16 00:01:00,868 --> 00:01:05,355 you can use functions if there is a set of actions which you are gonna use a lot of times. 17 00:01:05,355 --> 00:01:09,177 For example, you've written code to create a square, 18 00:01:09,177 --> 00:01:13,344 You could define this as a function called "create a square". 19 00:01:13,344 --> 00:01:18,926 Now you have a new block that you can use multiple times to create multiple squares. 20 00:01:19,816 --> 00:01:23,353 A lot of simple functions can be used, to create more complex patterns. 21 00:01:24,073 --> 00:01:25,519 In the next puzzle, 22 00:01:25,519 --> 00:01:28,112 the code you recently wrote to make a circle 23 00:01:28,112 --> 00:01:31,842 is available to you as a new function that can make circles of different sizes. 24 00:01:31,842 --> 00:01:36,309 Can you use it to help Elsa to create a new beautiful pattern in the snow?