1
00:00:00,880 --> 00:00:06,070
All right, I call this one the function eater, maybe too many Arnold Schwarzenegger movies, but it

2
00:00:06,070 --> 00:00:11,950
kind of suited because we did want to try out and work a lot with functions and get more familiar with

3
00:00:11,950 --> 00:00:15,270
what functions can do in this than this section.

4
00:00:15,760 --> 00:00:19,300
So the objective here is to listen for key presses.

5
00:00:19,300 --> 00:00:24,910
We're going to be listening for a sequence to be added in and we're going to store this as an array.

6
00:00:25,180 --> 00:00:31,870
And then once the user is ready to run the sequence of up, down, right, left and also changing the

7
00:00:31,870 --> 00:00:37,690
color, they can press the spacebar or the enter and that's going to run the sequence of where that

8
00:00:37,690 --> 00:00:38,800
element is going to move.

9
00:00:38,950 --> 00:00:45,460
You can also select and update the sequence by clicking and removing the different maneuvers that are

10
00:00:45,460 --> 00:00:47,400
already preset within the sequence.

11
00:00:47,800 --> 00:00:50,290
And this is a really fun and interesting one.

12
00:00:50,290 --> 00:00:54,460
And we'll really get you familiar with functions as well as element manipulation.

13
00:00:54,490 --> 00:00:55,150
Let me show you.

14
00:00:56,740 --> 00:01:03,640
So we're presented with a box, a regular element, and I can enter in some pressing my keyboard keys.

15
00:01:03,640 --> 00:01:06,190
I've got right down, left up all of these.

16
00:01:06,190 --> 00:01:09,220
I can proceed to change the color of the output.

17
00:01:09,520 --> 00:01:13,180
And then also, whenever I'm ready to run the sequence, I almost forgot.

18
00:01:13,330 --> 00:01:15,840
I can also remove items from the sequence.

19
00:01:16,060 --> 00:01:18,100
So let's say I put way too many rights.

20
00:01:18,100 --> 00:01:20,230
I can just simply click them and remove them.

21
00:01:20,560 --> 00:01:23,590
I'm going to do some down and hopefully it stays on the screen.

22
00:01:23,900 --> 00:01:26,740
Let me press space and we'll see it moving around.

23
00:01:27,010 --> 00:01:30,430
So it's moving around the screen now according to what the commands are.

24
00:01:30,550 --> 00:01:34,360
And then once it completes, you see that we can set new commands again.

25
00:01:34,360 --> 00:01:35,470
We can set the path again.
