Hey everyone.
So now we are done with this and also to let close dysfunction.
And now next thing is the winner.
Who is the winner.
So how to check that.
This one is a home vote for you.
Remember maybe you got the idea that how we are going to check the winner so whenever we are playing
this game you know the winner is someone who got the numbers.
That is like it.
This one horizontally vertically or diagonally.
That is the case is that either all the numbers in this room are equal or disconnected that is closer
to zero either.
These are equal either these are or same in horizontal case.
So we have approx six of these cases seven is this diagonal eight is this diagonal.
So we have these are these possible conditions in which there will be a winner.
So how we can get the idea that who wins.
So for that also we will define a function that is is we.
And in that we are going to pass two parameters that is bold and the letter.
And we have read and just be an L because we are going to require these a number of times so just use
short words because we didn't use any parameter.
You remember that thing I value.
So what to do here.
We just read done drew in case we have different options here.
Like B of let me first check this one.
One and that will be equal to l.
That is the letter like either zero or cross.
And with that B of two equal to equal to L and
B of 3.
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
is equal to the L that letter that is on current situation like it is 0 or X at that particular point.
Like a data computer move or the players move so it will check that the one that is on the move have
the situation like the all the three values will be equal to that.
So in that case that will be a winner.
So here we have done this one for line one.
Similarly we require this one for all the lines here.
So heavy values or net is otherwise this one and we will define something like again in Princes.
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.
So here we are using and in this situation situations because we require all the conditions to be true.
And here we are using or because any of these lines can be like this one.
All true but this is necessary that all the three values in that particular line into this one or the
horizontal diagonally we must be equal.
Then we will use.
Now what will we do.
We will do the same thing for the third line that is B of this and that one will be seven equal to equal
to the letter and B of eight equal to equal to letter and also the B of nine will be
equal to equal to the letter.
So that's the all horizontal cases like this one this one and this one.
Now we will do the same thing for what they legal cases and that will be something like.
Now I think you can also do that here one and this one is for.
This one is seven.
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
be equal to equal to l.
That is the first horizontal case Oh.
Now we need to do with the second one.
So this time just copy this one.
Come on C instead of writing again again.
Come on V now.
Here we have 2 5 and 8.
So we didn't write like 2 5 eight and one thing we are writing these cases again and again because there
is no way.
And by just writing only of one value.
And this is again I believe a perfect idea that how you can use the return function that you can do
whatever you want to in that one hand you're going to even do anything at any position in Python programming
you want to.
You just need to open your mind and focus on that.
Now for the total vertical line in just copy that one.
Come on V.
And in total we have 3 6 and 9.
So here this in the 3.
This one will be six and this will be nine.
So done with that also.
Now we are left with the diagonals the diagnose will be something like 1 5 and 9.
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
I believe fun five and nine.
Yes that's correct.
And the second diagonal that we have.
Same for that one come on C and come on V just g.
Change the values that is 3 5 and 7.
So just 3 5 will be same.
And this one 7 so done with all the 8 conditions.
Now even one of these will be true like we have all here more than Danville will be true then this may
have no effect because we are using all or just gives Drew then only one condition of these will be
true and any of this condition will be true only if all the three condition inside the princes must
be true you can just look a look at this problem like this is something we have applied in is the end
conditions and without fences the order conditions so that the end conditions will be done first because
they are in fancies then after we get like here this one true false false false false false then the
order condition will work and it will provide the output in that case so like if this one is true and
all the others are false it will provide true and if all the conditions in these are false it will provide
false leg in the case when in this situation that particular situation no none of these conditions is
true because B of like you know B of one is n here like zero is over letter Bill of faith this one is
also and so this condition is going something true but the B of nine is not equal to that one.
So this condition will not be so in that case all the values will be false and we have no winner.
So I hope you understand that how I go if you know this one is easy task so one thing here this are
three equal to operators so check out all the arrows if you got any there now we are done with the who
is the veena now we will move to the main tasks that is player move and the computer all that how we
can just write here and that will be added on that particular situation one more thing when I have added
three the position that is three is already we done number that in that case I am getting sorted this
space is occupied that also will fall on this board full and logical that will be in main logic so done
with the windows also close that one and now we will move to what left them playable so continuing the
next to you new deployable.