Hey everyone.
So now going for the algorithm.
And in this video we are going to cover these two that is descending the ball and the input.
Now as I have told you in this module we are going to vote like the practical bit that actually happens
not like the one we have done before.
So whatever we need to do here you will get that five functions are so important.
So the thing is whatever we need to do here we will not write that in the code.
We will define the function for everything and in the main code we will just call the functions and
then the function will perform there.
So the first thing we require the input.
So we will define a function that is like something insert let him do things here you need to focus
like you actually don't know where to use this where you are going to use this particular syntax of
insertion any element in your code.
So that's why we are defining the function here.
If we know that there we need to add this particular line we will not define function but you have just
it might not be.
You have just to write the algorithm and you get the first issue input.
You did not know where to insert this input because this one is going to be the main logic but the main
logic will be after these six problems.
So that's why we need to define the function.
Second thing like we have maybe defined functions many times I have done these things like define the
function by output a name that has no sense.
But in this case we are going to develop every function that makes some sense and particularly did not
do that.
So looking a function like this insert letter is we are going to insert any letter in this.
So this will be any letter that will be the barometer of this and for this input we require two parameter
not only just the parameter that is we have very quiet and under parameter that we call position just
by the US so that it will not be plenty and five require these two because the input that we are taking
from the user we should have to give it to a proper position.
So this will be on the board.
So like if I have entered sixth then I have made six then the position there.
In that case will be six.
It will insert the particular letter on the position of six and the letter.
In that case either maybe x that is this one or the all because we have only these two inputs so likely
is not the main input it will denoting the user's value like the zero or cross.
And this position is the main number that the user enters.
So here the position of my sorry the board on that particular position will be equal to the letter.
So here we have the letter that said about input.
One more thing in this we did not require to return anything because we just need that particular position
will be inserted with that letter.
That is the letter I have attended.
So we just need this thing.
We are not required to return anything to any program or call it just fill that particular position
with the letter.
So make sure of this one now after that we require the board presentable.
So how can we define design that what if you remember that board I am into letting the heavy in that
board we have something like nine columns in which we have begun inserting value so first thing you
notice there that all the nine positions are the input that not just the position like any drawing that
the inputs.
So we need a list something of like you know board a list that may have positions from 1 to 9 where
we can insert the values so we will define a list with the name board in which we have an empty string
that may be 0 or and X and what will we do instead of defining it is again and again we will call the
loop in that list like 4 x bin range and then trench will be then because we need to work up to 9 and
also 0 is not included because we do not have the position 0 we are working from 1 and up to 9 that
is one two three four five six and seven eight nine.
So an empty string for x in range a plus 1 2 9 that is the 10 dealing with 10 I hope how I have defined
this thing that means that you understand this thing that how I have defined this one.
So this is simple if you tried to understand this thing.
That what I have done here.
After that we have now the board.
Then we define the look of that board.
That how the things are.
They are like the rows and columns.
So we will define a function that is like print and board.
This one is also a good habit of when you have different words like print and pull.
Then the make the second word first letter capital so that it will be a little more understandable.
Then we have the barometer that is this bold the particular value of that.
What will we do then we will try to draw that by a finger like I use the strings then one two three
empty spaces.
Then this one then again one two three.
Again this one and it is not required to define up to date but still one two three.
After that we need to give an input at every position.
That is what we are how we are going to give depositions as like.
They act like a variable not just on the position.
And that will make happen like just an empty string plus
the board value that is decision on that particular index.
That is we begin with one then we have plus again this partition line then they use something like bowled
over and it goes on the second empty position.
And let me also add on this file so you can understand more we have to.
Don't lie.
And so by three days.
Don't be late.
Yes I want to play.
So here you'll notice that this thing is the first net I have made.
This.
If you notice on every position there like this one from this part to this part we have three these
straight lines.
That is one two and three and the input venue right write something like three.
And then this one is on the middle position not on the upper or lower one it's at exact middle one.
So I have defined the upper line that is this line.
Then I have made this line that is print first an empty string.
That is this thing.
This part on the left side.
Then I have this input that will be a variable that variable will be bold value at 1.
Then I have again an empty string with this symbol.
So if you have noticed I have this symbol and on the both side I have space there then I have the second
variable which I will write just board of two.
Then I will add here again.
That particular symbol.
Now we are here on this position.
That is v also defined input.
Then we have again a space in that one.
This one also requires us space.
Now here we have in this one we have also make this space in this one also.
Now again the variable and that variable will be you can add that well that is board three now closed
that print come on.
And again very quiet.
And then there is line like the upper one that we have defined.
So we need this one here.
Come on C..
Come on the line with that.
So we have defined from this to this this upper portion.
After that we need a partition line and that partition line will be print.
And just this one and add lines like three four nine maybe.
Well one two three four five six seven eight nine 10 20.
Maybe that's enough.
So now up to this one we have done.
Again we did quite the same thing.
So just come on C hole part do.
Come on.
V there.
But the only thing that will be different in that case.
Now we are defining for this line here we have the position that is 4 5 and 6.
So here we need four.
Then we need five.
And after that we need six there.
Next about the middle row.
So now we have also done the demon alone and we have the partition.
Now in the last draw we did not have the partition in last.
Just to we have this one one two three one two three.
That's about this one and then one two three.
Then we again need a line that consists of first an empty string then we have our board on that particular
position and that position will be seven.
I hope you are getting an idea that what I'm doing here and then we have again this one I hope in this
time you understand better.
So here we have on position eight then the empty string with this slight symbol.
So the district line it denotes general yield.
Here we have position nine.
So this plus symbol otherwise there will be an ad in the program.
That's what we want to have.
Now we defined this one also just this symbol left.
Like if I write here for seven.
Again this one is on the middle.
I have the last one draw empty.
So just print and did last draw that is one two three.
The straight line 1 2 3 straight line.
Also the straight line is the shift plus the key about returning Mac and about and on Windows.
So then with that.
So here we have also defined the board.
You can also pin this more by just calling the function he had been both now save up to this part and
go to away.
So we have done with the input.
We have designed people.
Now we will move for later this space is free and the.
So continue next video.
Thanks for watching and I haven't seen the next video.