1 00:00:05,970 --> 00:00:06,630 Hey everyone. 2 00:00:07,530 --> 00:00:12,920 So now we are done with this and also to let close dysfunction. 3 00:00:12,930 --> 00:00:16,180 And now next thing is the winner. 4 00:00:16,320 --> 00:00:17,560 Who is the winner. 5 00:00:17,610 --> 00:00:19,100 So how to check that. 6 00:00:19,100 --> 00:00:20,810 This one is a home vote for you. 7 00:00:20,880 --> 00:00:30,720 Remember maybe you got the idea that how we are going to check the winner so whenever we are playing 8 00:00:30,720 --> 00:00:34,830 this game you know the winner is someone who got the numbers. 9 00:00:34,830 --> 00:00:35,880 That is like it. 10 00:00:35,880 --> 00:00:40,170 This one horizontally vertically or diagonally. 11 00:00:40,320 --> 00:00:46,890 That is the case is that either all the numbers in this room are equal or disconnected that is closer 12 00:00:46,890 --> 00:00:48,890 to zero either. 13 00:00:48,900 --> 00:00:54,600 These are equal either these are or same in horizontal case. 14 00:00:54,600 --> 00:01:00,640 So we have approx six of these cases seven is this diagonal eight is this diagonal. 15 00:01:01,110 --> 00:01:07,500 So we have these are these possible conditions in which there will be a winner. 16 00:01:08,390 --> 00:01:13,220 So how we can get the idea that who wins. 17 00:01:13,220 --> 00:01:21,910 So for that also we will define a function that is is we. 18 00:01:22,640 --> 00:01:29,270 And in that we are going to pass two parameters that is bold and the letter. 19 00:01:30,470 --> 00:01:36,860 And we have read and just be an L because we are going to require these a number of times so just use 20 00:01:36,860 --> 00:01:39,480 short words because we didn't use any parameter. 21 00:01:39,500 --> 00:01:41,660 You remember that thing I value. 22 00:01:42,260 --> 00:01:45,020 So what to do here. 23 00:01:45,260 --> 00:01:52,350 We just read done drew in case we have different options here. 24 00:01:52,400 --> 00:01:57,900 Like B of let me first check this one. 25 00:01:58,130 --> 00:02:02,420 One and that will be equal to l. 26 00:02:02,480 --> 00:02:05,420 That is the letter like either zero or cross. 27 00:02:06,440 --> 00:02:17,450 And with that B of two equal to equal to L and 28 00:02:20,350 --> 00:02:21,730 B of 3. 29 00:02:21,770 --> 00:02:32,420 Also it will do and I think you get what I have done here is that if the value at B of fun that is decent 30 00:02:33,380 --> 00:02:43,280 is equal to the L that letter that is on current situation like it is 0 or X at that particular point. 31 00:02:43,560 --> 00:02:50,720 Like a data computer move or the players move so it will check that the one that is on the move have 32 00:02:51,770 --> 00:02:57,210 the situation like the all the three values will be equal to that. 33 00:02:57,290 --> 00:02:59,000 So in that case that will be a winner. 34 00:02:59,750 --> 00:03:02,930 So here we have done this one for line one. 35 00:03:03,050 --> 00:03:06,790 Similarly we require this one for all the lines here. 36 00:03:07,460 --> 00:03:18,840 So heavy values or net is otherwise this one and we will define something like again in Princes. 37 00:03:19,110 --> 00:03:41,030 B of 4 equal to equal to L and B of 5 equal to equal to L and B of 6 equal to equal to. 38 00:03:41,660 --> 00:03:47,790 So here we are using and in this situation situations because we require all the conditions to be true. 39 00:03:47,870 --> 00:03:55,270 And here we are using or because any of these lines can be like this one. 40 00:03:55,280 --> 00:04:01,250 All true but this is necessary that all the three values in that particular line into this one or the 41 00:04:01,250 --> 00:04:04,560 horizontal diagonally we must be equal. 42 00:04:04,820 --> 00:04:06,010 Then we will use. 43 00:04:06,830 --> 00:04:07,820 Now what will we do. 44 00:04:07,820 --> 00:04:18,680 We will do the same thing for the third line that is B of this and that one will be seven equal to equal 45 00:04:18,680 --> 00:04:33,260 to the letter and B of eight equal to equal to letter and also the B of nine will be 46 00:04:36,680 --> 00:04:38,510 equal to equal to the letter. 47 00:04:39,440 --> 00:04:46,850 So that's the all horizontal cases like this one this one and this one. 48 00:04:46,850 --> 00:04:52,980 Now we will do the same thing for what they legal cases and that will be something like. 49 00:04:53,000 --> 00:05:02,060 Now I think you can also do that here one and this one is for. 50 00:05:02,180 --> 00:05:03,170 This one is seven. 51 00:05:03,410 --> 00:05:18,650 So we need to do one equal to equal to L and B of four equal to equal to L and B of seven that will 52 00:05:18,650 --> 00:05:21,660 be equal to equal to l. 53 00:05:21,860 --> 00:05:24,840 That is the first horizontal case Oh. 54 00:05:25,430 --> 00:05:29,950 Now we need to do with the second one. 55 00:05:31,020 --> 00:05:34,640 So this time just copy this one. 56 00:05:34,640 --> 00:05:37,530 Come on C instead of writing again again. 57 00:05:37,880 --> 00:05:39,460 Come on V now. 58 00:05:39,680 --> 00:05:44,020 Here we have 2 5 and 8. 59 00:05:44,060 --> 00:05:53,850 So we didn't write like 2 5 eight and one thing we are writing these cases again and again because there 60 00:05:53,850 --> 00:05:54,730 is no way. 61 00:05:54,750 --> 00:05:58,290 And by just writing only of one value. 62 00:05:58,620 --> 00:06:06,450 And this is again I believe a perfect idea that how you can use the return function that you can do 63 00:06:06,450 --> 00:06:11,700 whatever you want to in that one hand you're going to even do anything at any position in Python programming 64 00:06:11,940 --> 00:06:12,590 you want to. 65 00:06:12,990 --> 00:06:16,690 You just need to open your mind and focus on that. 66 00:06:16,860 --> 00:06:23,100 Now for the total vertical line in just copy that one. 67 00:06:23,280 --> 00:06:24,660 Come on V. 68 00:06:24,870 --> 00:06:28,440 And in total we have 3 6 and 9. 69 00:06:28,470 --> 00:06:31,260 So here this in the 3. 70 00:06:31,860 --> 00:06:36,420 This one will be six and this will be nine. 71 00:06:36,540 --> 00:06:37,770 So done with that also. 72 00:06:38,430 --> 00:06:48,370 Now we are left with the diagonals the diagnose will be something like 1 5 and 9. 73 00:06:48,410 --> 00:07:05,180 So we need to do one that will be equal to equal to N and B of five equal to equal to L and B of nine 74 00:07:05,640 --> 00:07:08,190 I believe fun five and nine. 75 00:07:08,220 --> 00:07:10,480 Yes that's correct. 76 00:07:11,570 --> 00:07:14,900 And the second diagonal that we have. 77 00:07:14,900 --> 00:07:20,870 Same for that one come on C and come on V just g. 78 00:07:20,880 --> 00:07:25,210 Change the values that is 3 5 and 7. 79 00:07:25,240 --> 00:07:28,460 So just 3 5 will be same. 80 00:07:28,530 --> 00:07:34,000 And this one 7 so done with all the 8 conditions. 81 00:07:34,000 --> 00:07:42,220 Now even one of these will be true like we have all here more than Danville will be true then this may 82 00:07:42,400 --> 00:07:49,660 have no effect because we are using all or just gives Drew then only one condition of these will be 83 00:07:49,660 --> 00:07:58,750 true and any of this condition will be true only if all the three condition inside the princes must 84 00:07:58,750 --> 00:08:07,000 be true you can just look a look at this problem like this is something we have applied in is the end 85 00:08:07,000 --> 00:08:12,790 conditions and without fences the order conditions so that the end conditions will be done first because 86 00:08:12,790 --> 00:08:19,480 they are in fancies then after we get like here this one true false false false false false then the 87 00:08:19,480 --> 00:08:25,600 order condition will work and it will provide the output in that case so like if this one is true and 88 00:08:25,630 --> 00:08:33,460 all the others are false it will provide true and if all the conditions in these are false it will provide 89 00:08:33,460 --> 00:08:40,930 false leg in the case when in this situation that particular situation no none of these conditions is 90 00:08:40,930 --> 00:08:49,840 true because B of like you know B of one is n here like zero is over letter Bill of faith this one is 91 00:08:49,840 --> 00:08:54,900 also and so this condition is going something true but the B of nine is not equal to that one. 92 00:08:55,780 --> 00:09:02,130 So this condition will not be so in that case all the values will be false and we have no winner. 93 00:09:02,590 --> 00:09:11,640 So I hope you understand that how I go if you know this one is easy task so one thing here this are 94 00:09:11,820 --> 00:09:18,740 three equal to operators so check out all the arrows if you got any there now we are done with the who 95 00:09:18,750 --> 00:09:25,960 is the veena now we will move to the main tasks that is player move and the computer all that how we 96 00:09:25,960 --> 00:09:33,320 can just write here and that will be added on that particular situation one more thing when I have added 97 00:09:33,330 --> 00:09:39,440 three the position that is three is already we done number that in that case I am getting sorted this 98 00:09:39,440 --> 00:09:48,910 space is occupied that also will fall on this board full and logical that will be in main logic so done 99 00:09:48,910 --> 00:09:58,690 with the windows also close that one and now we will move to what left them playable so continuing the 100 00:09:58,690 --> 00:10:00,240 next to you new deployable.