1
00:00:00,180 --> 00:00:05,880
Are you ready to turn this into a game we ran through the most important part of this application,

2
00:00:05,910 --> 00:00:11,530
the last lesson, and that's where we're randomizing the order of items and contents of an array, I

3
00:00:11,550 --> 00:00:16,380
got to remove some of these console messages as we don't need them within our finished product.

4
00:00:17,550 --> 00:00:24,720
And I'm going to update this one here to output the content of the message, and I'm going to also create

5
00:00:24,720 --> 00:00:30,150
a global object called Scramble, and we'll start that out by being blank.

6
00:00:30,360 --> 00:00:39,300
And then when we start out and then take our message object and enter HTML update that value of scramble

7
00:00:39,510 --> 00:00:44,400
to be displayed there for the user to be able to see to values that we need to store.

8
00:00:44,610 --> 00:00:48,670
And this one, the scramble value is going to be the actual word.

9
00:00:48,720 --> 00:00:53,430
And we'll set up another object, another variable that we can contain scrambled.

10
00:00:53,550 --> 00:00:55,560
And this is going to be the scrambled word.

11
00:00:55,890 --> 00:01:03,000
So we've got our scramble and then we're going to set another value for scrambled and equal this to

12
00:01:03,180 --> 00:01:08,220
generating that random word, take that value out a variable that we were using.

13
00:01:08,970 --> 00:01:10,830
And we don't need that in place here.

14
00:01:10,950 --> 00:01:13,980
And we're taking whatever the value of scramble is.

15
00:01:13,980 --> 00:01:18,390
And we're going to split that and send that over to our JavaScript.

16
00:01:18,420 --> 00:01:24,030
So randomizing our array value and then instead of putting the scramble, we're going to output the

17
00:01:24,030 --> 00:01:24,600
scrambled.

18
00:01:24,690 --> 00:01:31,080
And we also need to bring this one back together so that it's not an array anymore, so that we can

19
00:01:31,080 --> 00:01:36,750
do with what we saw earlier as well, where we use join in order to join it together.

20
00:01:37,080 --> 00:01:42,900
And so now we get our scrambled word and it's all joined together so we can output.

21
00:01:42,900 --> 00:01:49,030
The scrambled for now will also output the word that's unscrambled as well.

22
00:01:49,170 --> 00:01:53,490
So do we see that this is course this once course as well document.

23
00:01:54,090 --> 00:02:00,020
So coming up next, we need to provide the player the ability to guess at what the word is.

24
00:02:00,330 --> 00:02:02,610
So let's add that in in the next lesson.

25
00:02:02,910 --> 00:02:09,300
So for now, add in and update the scramble part of the word that we worked on the previous lesson,

26
00:02:09,510 --> 00:02:16,380
join it together and then have a scrambled word and a scramble word that's going to be scrambled and

27
00:02:16,380 --> 00:02:22,290
creating a word randomly from our array using the create word function that we created earlier.
