1
00:00:00,240 --> 00:00:04,990
This lesson is going to be a quick fix on an issue as we're debugging our application.

2
00:00:05,040 --> 00:00:10,170
So sometimes you do have to play through the game and you can detect if there are some instances of

3
00:00:10,170 --> 00:00:10,560
a bug.

4
00:00:10,860 --> 00:00:16,290
And in this case, what's happening here is that if we do have two matching cards, they're still going

5
00:00:16,290 --> 00:00:20,030
into playoffs, even though the last player beat both of those cards.

6
00:00:20,250 --> 00:00:21,960
So this one actually should be the winner.

7
00:00:21,960 --> 00:00:26,910
Player three should be the winner and he should have won all three of the cards and this should have

8
00:00:26,910 --> 00:00:28,440
never gone into the playoff round.

9
00:00:28,740 --> 00:00:30,960
So there is a code update that we have to do.

10
00:00:31,170 --> 00:00:38,340
And the place to add that in is where we look and we see that if we have a greater than the current

11
00:00:38,340 --> 00:00:41,400
high, then what we're doing is we're overriding the winner.

12
00:00:41,520 --> 00:00:49,110
And we should also clear out the playoff values, as in this case we're running through and we're clearing

13
00:00:49,110 --> 00:00:53,990
out all of the playoff content values anymore and we just can clear that out.

14
00:00:54,000 --> 00:01:00,480
So we're clearing out the playoff array if the current card value is higher than the current high card.

15
00:01:00,660 --> 00:01:02,270
So let's try that out.

16
00:01:02,280 --> 00:01:06,110
And again, in order to test this out, ranks values.

17
00:01:06,110 --> 00:01:11,320
So we're playing with less cards so we can better simulate this occurrence happening again.

18
00:01:11,730 --> 00:01:15,120
So go ahead and make that quick update of the code.

19
00:01:15,600 --> 00:01:18,630
It might take a little bit of time to reproduce the error.

20
00:01:18,840 --> 00:01:24,570
So over here, we were able to simulate that issue that we saw earlier where we've got one player that

21
00:01:24,570 --> 00:01:27,690
gets the high card, the next player gets the same high card.

22
00:01:27,810 --> 00:01:30,090
So these two are in a playoff situation.

23
00:01:30,180 --> 00:01:32,930
But then the third player comes along and beats both of them.

24
00:01:32,940 --> 00:01:38,130
And this is what's happened here is where Player three ended up canceling out the playoff between the

25
00:01:38,130 --> 00:01:41,040
first two players because this one ended up with a higher card.

26
00:01:41,310 --> 00:01:44,850
So that was a quick fix and a quick debug on the application.

27
00:01:45,030 --> 00:01:47,460
So go ahead and make that update in your code.
