1 00:00:05,870 --> 00:00:07,250 Hey everyone. 2 00:00:07,400 --> 00:00:11,210 So now going for the algorithm. 3 00:00:11,420 --> 00:00:17,660 And in this video we are going to cover these two that is descending the ball and the input. 4 00:00:17,660 --> 00:00:23,650 Now as I have told you in this module we are going to vote like the practical bit that actually happens 5 00:00:23,690 --> 00:00:25,890 not like the one we have done before. 6 00:00:25,910 --> 00:00:32,250 So whatever we need to do here you will get that five functions are so important. 7 00:00:32,330 --> 00:00:37,400 So the thing is whatever we need to do here we will not write that in the code. 8 00:00:37,700 --> 00:00:44,060 We will define the function for everything and in the main code we will just call the functions and 9 00:00:44,060 --> 00:00:46,280 then the function will perform there. 10 00:00:47,040 --> 00:00:50,420 So the first thing we require the input. 11 00:00:50,720 --> 00:01:00,050 So we will define a function that is like something insert let him do things here you need to focus 12 00:01:01,700 --> 00:01:08,390 like you actually don't know where to use this where you are going to use this particular syntax of 13 00:01:08,480 --> 00:01:11,270 insertion any element in your code. 14 00:01:11,420 --> 00:01:14,430 So that's why we are defining the function here. 15 00:01:14,910 --> 00:01:21,930 If we know that there we need to add this particular line we will not define function but you have just 16 00:01:23,230 --> 00:01:24,300 it might not be. 17 00:01:24,600 --> 00:01:28,810 You have just to write the algorithm and you get the first issue input. 18 00:01:28,830 --> 00:01:33,360 You did not know where to insert this input because this one is going to be the main logic but the main 19 00:01:33,360 --> 00:01:37,550 logic will be after these six problems. 20 00:01:37,820 --> 00:01:41,090 So that's why we need to define the function. 21 00:01:41,090 --> 00:01:48,050 Second thing like we have maybe defined functions many times I have done these things like define the 22 00:01:48,050 --> 00:01:51,710 function by output a name that has no sense. 23 00:01:51,710 --> 00:01:57,390 But in this case we are going to develop every function that makes some sense and particularly did not 24 00:01:57,390 --> 00:01:58,290 do that. 25 00:01:58,290 --> 00:02:03,970 So looking a function like this insert letter is we are going to insert any letter in this. 26 00:02:04,730 --> 00:02:14,900 So this will be any letter that will be the barometer of this and for this input we require two parameter 27 00:02:15,110 --> 00:02:22,900 not only just the parameter that is we have very quiet and under parameter that we call position just 28 00:02:22,900 --> 00:02:30,230 by the US so that it will not be plenty and five require these two because the input that we are taking 29 00:02:30,230 --> 00:02:34,130 from the user we should have to give it to a proper position. 30 00:02:34,160 --> 00:02:37,190 So this will be on the board. 31 00:02:38,060 --> 00:02:46,930 So like if I have entered sixth then I have made six then the position there. 32 00:02:46,930 --> 00:02:48,440 In that case will be six. 33 00:02:48,440 --> 00:02:52,500 It will insert the particular letter on the position of six and the letter. 34 00:02:52,520 --> 00:03:01,640 In that case either maybe x that is this one or the all because we have only these two inputs so likely 35 00:03:01,640 --> 00:03:07,520 is not the main input it will denoting the user's value like the zero or cross. 36 00:03:07,850 --> 00:03:12,180 And this position is the main number that the user enters. 37 00:03:12,200 --> 00:03:19,430 So here the position of my sorry the board on that particular position will be equal to the letter. 38 00:03:19,760 --> 00:03:25,220 So here we have the letter that said about input. 39 00:03:25,370 --> 00:03:32,490 One more thing in this we did not require to return anything because we just need that particular position 40 00:03:32,490 --> 00:03:35,070 will be inserted with that letter. 41 00:03:35,120 --> 00:03:36,900 That is the letter I have attended. 42 00:03:37,710 --> 00:03:39,290 So we just need this thing. 43 00:03:39,290 --> 00:03:44,460 We are not required to return anything to any program or call it just fill that particular position 44 00:03:44,490 --> 00:03:45,700 with the letter. 45 00:03:46,110 --> 00:03:54,050 So make sure of this one now after that we require the board presentable. 46 00:03:54,220 --> 00:04:02,320 So how can we define design that what if you remember that board I am into letting the heavy in that 47 00:04:02,320 --> 00:04:09,560 board we have something like nine columns in which we have begun inserting value so first thing you 48 00:04:09,560 --> 00:04:16,100 notice there that all the nine positions are the input that not just the position like any drawing that 49 00:04:16,100 --> 00:04:17,180 the inputs. 50 00:04:17,240 --> 00:04:27,170 So we need a list something of like you know board a list that may have positions from 1 to 9 where 51 00:04:27,170 --> 00:04:34,190 we can insert the values so we will define a list with the name board in which we have an empty string 52 00:04:34,190 --> 00:04:41,720 that may be 0 or and X and what will we do instead of defining it is again and again we will call the 53 00:04:41,720 --> 00:04:53,300 loop in that list like 4 x bin range and then trench will be then because we need to work up to 9 and 54 00:04:53,300 --> 00:04:59,780 also 0 is not included because we do not have the position 0 we are working from 1 and up to 9 that 55 00:04:59,780 --> 00:05:03,110 is one two three four five six and seven eight nine. 56 00:05:03,410 --> 00:05:14,180 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 57 00:05:14,180 --> 00:05:21,070 this thing that means that you understand this thing that how I have defined this one. 58 00:05:21,380 --> 00:05:24,580 So this is simple if you tried to understand this thing. 59 00:05:24,590 --> 00:05:27,940 That what I have done here. 60 00:05:28,100 --> 00:05:32,490 After that we have now the board. 61 00:05:32,900 --> 00:05:36,040 Then we define the look of that board. 62 00:05:36,320 --> 00:05:38,460 That how the things are. 63 00:05:38,500 --> 00:05:40,040 They are like the rows and columns. 64 00:05:40,040 --> 00:05:49,060 So we will define a function that is like print and board. 65 00:05:49,190 --> 00:05:54,020 This one is also a good habit of when you have different words like print and pull. 66 00:05:54,140 --> 00:06:01,640 Then the make the second word first letter capital so that it will be a little more understandable. 67 00:06:01,820 --> 00:06:09,830 Then we have the barometer that is this bold the particular value of that. 68 00:06:12,320 --> 00:06:20,150 What will we do then we will try to draw that by a finger like I use the strings then one two three 69 00:06:20,150 --> 00:06:21,710 empty spaces. 70 00:06:21,770 --> 00:06:25,500 Then this one then again one two three. 71 00:06:25,670 --> 00:06:32,970 Again this one and it is not required to define up to date but still one two three. 72 00:06:33,770 --> 00:06:40,310 After that we need to give an input at every position. 73 00:06:40,310 --> 00:06:45,510 That is what we are how we are going to give depositions as like. 74 00:06:45,590 --> 00:06:48,990 They act like a variable not just on the position. 75 00:06:49,010 --> 00:06:53,390 And that will make happen like just an empty string plus 76 00:06:56,590 --> 00:07:00,990 the board value that is decision on that particular index. 77 00:07:01,000 --> 00:07:15,970 That is we begin with one then we have plus again this partition line then they use something like bowled 78 00:07:16,100 --> 00:07:19,440 over and it goes on the second empty position. 79 00:07:19,690 --> 00:07:29,430 And let me also add on this file so you can understand more we have to. 80 00:07:29,580 --> 00:07:32,090 Don't lie. 81 00:07:32,280 --> 00:07:36,720 And so by three days. 82 00:07:36,860 --> 00:07:38,730 Don't be late. 83 00:07:38,880 --> 00:07:40,020 Yes I want to play. 84 00:07:40,080 --> 00:07:44,340 So here you'll notice that this thing is the first net I have made. 85 00:07:44,340 --> 00:07:45,880 This. 86 00:07:45,930 --> 00:07:53,460 If you notice on every position there like this one from this part to this part we have three these 87 00:07:53,460 --> 00:07:54,630 straight lines. 88 00:07:54,630 --> 00:07:59,750 That is one two and three and the input venue right write something like three. 89 00:07:59,870 --> 00:08:06,770 And then this one is on the middle position not on the upper or lower one it's at exact middle one. 90 00:08:06,780 --> 00:08:11,040 So I have defined the upper line that is this line. 91 00:08:11,310 --> 00:08:14,700 Then I have made this line that is print first an empty string. 92 00:08:14,700 --> 00:08:15,740 That is this thing. 93 00:08:15,750 --> 00:08:17,770 This part on the left side. 94 00:08:17,890 --> 00:08:25,710 Then I have this input that will be a variable that variable will be bold value at 1. 95 00:08:25,860 --> 00:08:30,000 Then I have again an empty string with this symbol. 96 00:08:30,000 --> 00:08:36,860 So if you have noticed I have this symbol and on the both side I have space there then I have the second 97 00:08:37,400 --> 00:08:42,350 variable which I will write just board of two. 98 00:08:42,860 --> 00:08:45,560 Then I will add here again. 99 00:08:45,560 --> 00:08:48,110 That particular symbol. 100 00:08:48,320 --> 00:08:51,420 Now we are here on this position. 101 00:08:51,770 --> 00:08:53,210 That is v also defined input. 102 00:08:53,220 --> 00:08:55,360 Then we have again a space in that one. 103 00:08:55,370 --> 00:08:58,760 This one also requires us space. 104 00:08:58,760 --> 00:09:05,290 Now here we have in this one we have also make this space in this one also. 105 00:09:05,300 --> 00:09:15,250 Now again the variable and that variable will be you can add that well that is board three now closed 106 00:09:15,250 --> 00:09:16,820 that print come on. 107 00:09:17,660 --> 00:09:19,840 And again very quiet. 108 00:09:20,630 --> 00:09:24,480 And then there is line like the upper one that we have defined. 109 00:09:24,560 --> 00:09:26,360 So we need this one here. 110 00:09:26,360 --> 00:09:27,450 Come on C.. 111 00:09:27,560 --> 00:09:29,570 Come on the line with that. 112 00:09:29,870 --> 00:09:35,240 So we have defined from this to this this upper portion. 113 00:09:35,240 --> 00:09:43,970 After that we need a partition line and that partition line will be print. 114 00:09:44,360 --> 00:09:49,990 And just this one and add lines like three four nine maybe. 115 00:09:50,000 --> 00:09:55,750 Well one two three four five six seven eight nine 10 20. 116 00:09:55,980 --> 00:09:57,800 Maybe that's enough. 117 00:09:58,580 --> 00:10:02,570 So now up to this one we have done. 118 00:10:02,570 --> 00:10:04,760 Again we did quite the same thing. 119 00:10:04,760 --> 00:10:08,110 So just come on C hole part do. 120 00:10:08,150 --> 00:10:08,650 Come on. 121 00:10:08,650 --> 00:10:09,180 V there. 122 00:10:09,560 --> 00:10:12,310 But the only thing that will be different in that case. 123 00:10:12,410 --> 00:10:19,040 Now we are defining for this line here we have the position that is 4 5 and 6. 124 00:10:19,040 --> 00:10:21,740 So here we need four. 125 00:10:22,010 --> 00:10:24,050 Then we need five. 126 00:10:24,200 --> 00:10:27,980 And after that we need six there. 127 00:10:28,160 --> 00:10:31,170 Next about the middle row. 128 00:10:31,190 --> 00:10:35,010 So now we have also done the demon alone and we have the partition. 129 00:10:35,270 --> 00:10:39,440 Now in the last draw we did not have the partition in last. 130 00:10:39,440 --> 00:10:45,360 Just to we have this one one two three one two three. 131 00:10:45,750 --> 00:10:49,690 That's about this one and then one two three. 132 00:10:49,730 --> 00:10:59,380 Then we again need a line that consists of first an empty string then we have our board on that particular 133 00:10:59,380 --> 00:11:04,290 position and that position will be seven. 134 00:11:04,360 --> 00:11:13,060 I hope you are getting an idea that what I'm doing here and then we have again this one I hope in this 135 00:11:13,060 --> 00:11:15,480 time you understand better. 136 00:11:16,240 --> 00:11:24,370 So here we have on position eight then the empty string with this slight symbol. 137 00:11:24,370 --> 00:11:29,260 So the district line it denotes general yield. 138 00:11:29,590 --> 00:11:32,940 Here we have position nine. 139 00:11:33,010 --> 00:11:38,420 So this plus symbol otherwise there will be an ad in the program. 140 00:11:38,450 --> 00:11:41,300 That's what we want to have. 141 00:11:42,280 --> 00:11:46,450 Now we defined this one also just this symbol left. 142 00:11:46,630 --> 00:11:48,760 Like if I write here for seven. 143 00:11:48,850 --> 00:11:50,500 Again this one is on the middle. 144 00:11:50,530 --> 00:11:52,940 I have the last one draw empty. 145 00:11:53,170 --> 00:12:01,740 So just print and did last draw that is one two three. 146 00:12:01,940 --> 00:12:04,450 The straight line 1 2 3 straight line. 147 00:12:04,450 --> 00:12:12,610 Also the straight line is the shift plus the key about returning Mac and about and on Windows. 148 00:12:13,720 --> 00:12:15,580 So then with that. 149 00:12:16,000 --> 00:12:19,230 So here we have also defined the board. 150 00:12:19,300 --> 00:12:28,850 You can also pin this more by just calling the function he had been both now save up to this part and 151 00:12:28,850 --> 00:12:29,610 go to away. 152 00:12:30,260 --> 00:12:32,440 So we have done with the input. 153 00:12:32,780 --> 00:12:34,330 We have designed people. 154 00:12:34,910 --> 00:12:40,720 Now we will move for later this space is free and the. 155 00:12:41,210 --> 00:12:43,380 So continue next video. 156 00:12:43,790 --> 00:12:46,100 Thanks for watching and I haven't seen the next video.