1
00:00:00,480 --> 00:00:06,720
If there's one type of game that students that take my courses seem to love, and those are card games,

2
00:00:06,960 --> 00:00:12,510
so this idea for the game came to me from a really simple card game where you divide a deck of cards,

3
00:00:12,750 --> 00:00:17,070
each player gets a certain stack of the cards, dealt a certain stock of the cards.

4
00:00:17,220 --> 00:00:21,090
And then really the objective is you simply turn over the top card.

5
00:00:21,270 --> 00:00:26,210
Whoever has the highest card wins, wins the pot and you try to get all the cards.

6
00:00:26,340 --> 00:00:28,310
So if you run out of cards, you lose.

7
00:00:28,320 --> 00:00:30,130
If you get all the cards, you win.

8
00:00:30,360 --> 00:00:33,900
So this is JavaScript game and it's also very visual.

9
00:00:34,050 --> 00:00:40,620
So I've added in the visual cards as well so that we can have a really nice, presentable game for people

10
00:00:40,620 --> 00:00:41,130
to play it.

11
00:00:41,250 --> 00:00:44,940
And there's also some dynamic stuff here where you can select the number of players.

12
00:00:44,940 --> 00:00:47,910
It will automatically deal the cards to each one of the players.

13
00:00:48,060 --> 00:00:53,640
And also, if you have played this kind of card game before, you know, it kind of gets quite lengthy

14
00:00:53,640 --> 00:00:55,430
and quite long and boring.

15
00:00:55,440 --> 00:01:01,500
So I've also added in because, of course, where JavaScript programmers and we can add in some functionality

16
00:01:01,500 --> 00:01:07,920
that we want to add and make things a lot quicker so we can play hundreds of rounds instantly with this

17
00:01:07,920 --> 00:01:08,340
game.

18
00:01:08,340 --> 00:01:12,360
And it's going to run through all of the code instantly showing you everything.

19
00:01:12,360 --> 00:01:18,210
And that's an added feature that I've added into this game to make it more functional and to, quite

20
00:01:18,210 --> 00:01:20,460
honestly, to prevent boredom.

21
00:01:21,030 --> 00:01:22,130
So let let me show you.

22
00:01:23,100 --> 00:01:26,280
So you come in and you can select any number of players you want.

23
00:01:26,520 --> 00:01:28,470
In this case, I'm going to select four players.

24
00:01:28,680 --> 00:01:34,020
So we see that each one of the players gets the cards, dealt with them.

25
00:01:34,200 --> 00:01:40,140
And seems like player four has the high card here so that each player started with thirteen cards because

26
00:01:40,140 --> 00:01:41,940
that's the deck of cards is 52.

27
00:01:42,150 --> 00:01:45,780
So each one got dealt thirteen and player four had the high card.

28
00:01:45,900 --> 00:01:50,190
So he won or she won all of the other cards.

29
00:01:50,340 --> 00:01:51,860
So that's been added in.

30
00:01:51,870 --> 00:01:56,340
And now we can attack as many times as we want and we can update the amount of rounds that we play through

31
00:01:56,340 --> 00:01:56,820
as well.

32
00:01:56,940 --> 00:02:00,080
And you can see the scoring of all of the cards is down there below.

33
00:02:00,240 --> 00:02:04,650
So if you want it to run like five hundred rounds or something like that, you can see which players

34
00:02:04,650 --> 00:02:06,600
have lost, which players have won.

35
00:02:06,690 --> 00:02:12,090
And there's also a functionality in here if they're drawing the same card that we draw the next card

36
00:02:12,210 --> 00:02:19,860
until one player either runs out of cards or the other player matches and beats the card of the existing

37
00:02:19,860 --> 00:02:21,560
player, and then that's the one that's the winner.

38
00:02:21,690 --> 00:02:22,920
So the winner isn't green.

39
00:02:22,920 --> 00:02:28,230
Let's do five hundred more rounds and we see that player four is still hanging on here.

40
00:02:28,230 --> 00:02:31,800
So this is a thousand over a thousand rounds we've played.

41
00:02:31,950 --> 00:02:34,110
It also tracks down who won.

42
00:02:34,110 --> 00:02:36,360
All of the stats is being written out here.

43
00:02:36,510 --> 00:02:41,430
So you can see each round that gets played, it gets added into the scoring there.

44
00:02:41,940 --> 00:02:44,520
So a lot of really cool functionality in this game.

45
00:02:44,520 --> 00:02:50,250
And I do suggest that you try it out and have some fun with it, enjoy it and see what you can do and

46
00:02:50,250 --> 00:02:52,700
see what tweaks and updates you can make to this game.

47
00:02:53,190 --> 00:02:55,080
Thanks again for taking the section.
