1
00:00:00,480 --> 00:00:06,210
So here as you can see in line number three hundred and fifty five we have actually a value of L which

2
00:00:06,210 --> 00:00:11,890
is of type integer and the name of this variable is correct animal name index.

3
00:00:11,910 --> 00:00:17,810
So I put an assignment operator here and then I referred to the name to the name of this list here.

4
00:00:17,880 --> 00:00:24,820
All animals names list dot index of correct animals answer.

5
00:00:24,840 --> 00:00:28,960
So here I have to actually get the index of the correct animal answer.

6
00:00:29,040 --> 00:00:34,270
So as you can see here in say the Smurfette short and this animal here in line number three hundred

7
00:00:34,260 --> 00:00:41,260
and fit a frailty as you can see I am actually assigning This next animal image name to describe animals.

8
00:00:41,280 --> 00:00:47,670
And so in order to specify that what is going to be actually the correct answer.

9
00:00:47,670 --> 00:00:47,940
Right.

10
00:00:47,940 --> 00:00:55,320
So then in line number twenty nine I actually removed this value from the index zero of these all animals

11
00:00:55,320 --> 00:01:00,920
names list and then I assigned this value to this valuable which is of types three in name.

12
00:01:01,040 --> 00:01:06,220
Next animal image name in line number three hundred and fifty as you can see I am assigning.

13
00:01:06,220 --> 00:01:08,760
Next animal image name to this correct animals answer.

14
00:01:08,880 --> 00:01:14,530
So this valuable actually holds the correct answer of the current question.

15
00:01:14,550 --> 00:01:17,230
So now let's look at this line of code here.

16
00:01:17,310 --> 00:01:21,930
As you can see I am actually fairly new to the name of this list here.

17
00:01:21,930 --> 00:01:23,390
All animals names list.

18
00:01:23,410 --> 00:01:25,400
So that index of.

19
00:01:25,410 --> 00:01:29,840
So now you want to actually get the index of these value correct.

20
00:01:29,850 --> 00:01:32,630
Animals answer inside this list.

21
00:01:32,690 --> 00:01:36,440
So the index is going to be an integer value right.

22
00:01:36,720 --> 00:01:43,350
And then it's going to assign that value to the integer variable correct and and immortally index in

23
00:01:43,350 --> 00:01:45,780
line number three hundred and fifty six.

24
00:01:45,780 --> 00:01:51,270
As you can see we have actually a variable of type streams and the name of this variable is correct.

25
00:01:51,270 --> 00:01:52,380
Animal name.

26
00:01:52,470 --> 00:01:58,240
And then I put an assignment operator here and then I refer it to the name of this list all Alamance

27
00:01:58,320 --> 00:02:00,620
names list dot remove.

28
00:02:00,840 --> 00:02:03,250
So now I want to remove this value.

29
00:02:03,430 --> 00:02:06,270
Correct animal name index.

30
00:02:06,270 --> 00:02:06,760
Right.

31
00:02:06,900 --> 00:02:11,670
So here as you can see I am actually the first I am actually getting the index of this value inside

32
00:02:11,690 --> 00:02:12,630
this list right.

33
00:02:12,750 --> 00:02:18,000
And that I am assigning that index to this value in line number three hundred and fifty six.

34
00:02:18,000 --> 00:02:24,720
I am actually removing this value that is inside of this index inside this list.

35
00:02:24,840 --> 00:02:31,030
So all animals names list that remove the value that is inside of this index.

36
00:02:31,080 --> 00:02:32,850
Correct animal name index.

37
00:02:33,120 --> 00:02:37,140
And then it's going to actually remove and then and then it's going to actually remove that value and

38
00:02:37,140 --> 00:02:40,350
then it's going to assign that removed value to this correct.

39
00:02:40,360 --> 00:02:41,540
And any money right.

40
00:02:41,550 --> 00:02:47,430
So this string variable now holds that removed value that is inside of this index.

41
00:02:47,430 --> 00:02:47,780
Correct.

42
00:02:47,790 --> 00:02:51,990
And the name index and in line number three hundred fifty seven.

43
00:02:52,110 --> 00:02:56,040
I actually again I think this value this all animal names list.

44
00:02:56,100 --> 00:03:02,270
But this time this value correct animal name is going to be added to the last index.

45
00:03:02,300 --> 00:03:07,280
So now let me explain again here in line number three hundred fifty five.

46
00:03:07,280 --> 00:03:11,510
I am actually getting the index of the correct answer of the current question.

47
00:03:11,510 --> 00:03:15,740
So now let me show you the emulator as you can see this is the emulator.

48
00:03:15,870 --> 00:03:18,420
And here this is actually our current question.

49
00:03:18,420 --> 00:03:19,910
So here we have an ant.

50
00:03:19,920 --> 00:03:22,240
So let's look at this question.

51
00:03:22,460 --> 00:03:26,480
And now as you can see here I am actually getting the correct answer.

52
00:03:26,490 --> 00:03:28,900
The index of the correct answer in say the least.

53
00:03:28,920 --> 00:03:33,300
So it's going to give us that in days and then it's going to actually sign that index to this variable

54
00:03:33,300 --> 00:03:37,740
which is a finite integer in line number three hundred and fifty six.

55
00:03:37,740 --> 00:03:41,630
As you can see we have actually a variable of type streams.

56
00:03:41,850 --> 00:03:44,930
And the name of this variable is correct animal name.

57
00:03:45,000 --> 00:03:45,890
Right.

58
00:03:46,080 --> 00:03:52,930
And then I put an assignment operator here and then I referred to the name of this list.

59
00:03:53,130 --> 00:03:55,950
All animals names list dot remove.

60
00:03:55,950 --> 00:03:59,900
Now you want to remove this value that is inside of this index.

61
00:03:59,940 --> 00:04:05,550
Correct animal name index and then it's going to actually assign that removed value to this correct

62
00:04:05,580 --> 00:04:06,580
animal name.

63
00:04:07,050 --> 00:04:13,200
And then in line number three hundred and fifty seven I want to actually add this correct animal name

64
00:04:13,200 --> 00:04:19,800
to the last index of this all animal names list because of the reason that you were actually doing this

65
00:04:19,800 --> 00:04:20,140
here.

66
00:04:20,160 --> 00:04:22,280
I am actually removing this.

67
00:04:22,290 --> 00:04:23,250
The correct answer.

68
00:04:23,240 --> 00:04:27,060
The name of the correct animal name here from this list.

69
00:04:27,090 --> 00:04:28,700
And then I am actually adding it.

70
00:04:28,700 --> 00:04:36,320
Adding this value with the correct animal into this list because first I want to specify the other values

71
00:04:36,330 --> 00:04:39,230
so as you can see here we have an aunt right.

72
00:04:39,240 --> 00:04:45,820
So first you should actually specify the other options for example fish Chad bird right.

73
00:04:45,840 --> 00:04:48,130
First I want to specify these values here.

74
00:04:48,270 --> 00:04:53,620
And finally I can actually add the answer to this quiz.

75
00:04:53,940 --> 00:04:54,500
OK.

76
00:04:54,900 --> 00:05:02,530
I don't want to actually just randomly just put the answer here as an option.

77
00:05:02,550 --> 00:05:05,120
First I want to specify the other options.

78
00:05:05,160 --> 00:05:10,950
Fish for fish cats or bird and then at the end of the Smurfette you can see that you will see that we

79
00:05:10,950 --> 00:05:16,020
are going to add the answer here by using another algorithm.

80
00:05:16,230 --> 00:05:22,980
But in this way when we actually add the correct animal name to an index the last index of this list

81
00:05:23,250 --> 00:05:30,060
in this way we are not going to for example actually by accident at the answer here between the options

82
00:05:30,120 --> 00:05:31,170
between the guest buttons.

83
00:05:31,200 --> 00:05:32,310
Right.

84
00:05:32,310 --> 00:05:36,480
So first I want to be sure that the answer is not actually between the buttons.

85
00:05:36,630 --> 00:05:41,700
And then I will actually substitute with the answer with another option.

86
00:05:42,610 --> 00:05:46,330
So for now I just know that here that we are actually doing this.

87
00:05:46,330 --> 00:05:53,020
Is that the reason that we're doing here is that because first I want to actually remove the value that

88
00:05:53,020 --> 00:05:56,380
is inside of it that is inside of the index.

89
00:05:56,410 --> 00:05:57,680
Correct answer.

90
00:05:57,790 --> 00:06:03,310
And then of which we are going to add that value again to this list so that that value is going to be

91
00:06:03,310 --> 00:06:06,150
added to the last index of this list.

92
00:06:06,160 --> 00:06:09,660
And now let me actually talk about this for loop here.

93
00:06:09,700 --> 00:06:10,940
As you can see.

94
00:06:11,230 --> 00:06:13,450
So now let's look at this for love here.

95
00:06:13,510 --> 00:06:18,560
As you can see if you have a full loop and inside the practices of this follow up as you can see we

96
00:06:18,580 --> 00:06:23,210
have actually Avari about an integer and the name of this variable is a row.

97
00:06:23,500 --> 00:06:26,650
And then I assigned the values 0 to this variable.

98
00:06:26,650 --> 00:06:27,550
Right.

99
00:06:27,550 --> 00:06:32,170
And then here I actually created a condition that actually determines that.

100
00:06:32,230 --> 00:06:36,090
How many times this for loop here is going to be executed.

101
00:06:36,100 --> 00:06:42,480
So until then I do have this low here is actually less than the value of this number of animals gets

102
00:06:42,490 --> 00:06:43,440
lost here.

103
00:06:43,660 --> 00:06:49,470
As you can see so this variable is going to actually specify that how many number of guests throws we

104
00:06:49,490 --> 00:06:51,520
are going to have inside our quiz.

105
00:06:51,520 --> 00:06:55,980
So now let me show you the emulator as you can see as you can see here we have actually to get through

106
00:06:56,350 --> 00:07:02,360
the first year so is here that contains these two buttons on it and fish and the second.

107
00:07:02,390 --> 00:07:06,130
So is this one that actually contains these two buttons.

108
00:07:06,250 --> 00:07:07,850
The bird and the cat.

109
00:07:07,960 --> 00:07:13,870
So and that he had finally here we are actually saying that after each execution of this for a loop

110
00:07:13,870 --> 00:07:18,770
here we're going to add one value to the value of these row of idea.

111
00:07:19,090 --> 00:07:24,910
So now as you can see here inside this for loop here we have another for loop as you can see here.

112
00:07:24,910 --> 00:07:27,830
So this is actually on an inner for loop as you can see.

113
00:07:28,090 --> 00:07:29,730
So let's look at this fall here.

114
00:07:29,740 --> 00:07:36,090
So for it and here we actually created over the table and the name of this variable is column.

115
00:07:36,340 --> 00:07:39,710
And then I assigned the value zero to this variable.

116
00:07:40,060 --> 00:07:45,960
And here again we're actually creating a condition that actually determines that how many times this

117
00:07:45,960 --> 00:07:47,970
follows here is going to be executed.

118
00:07:47,980 --> 00:07:55,360
So until the value of this column variable is less than the value of the lows of guess bottoms in animal

119
00:07:55,360 --> 00:07:56,190
animalcules.

120
00:07:56,200 --> 00:08:00,910
So now let's actually scroll to the top here in order to show you with this variable here as you can

121
00:08:00,910 --> 00:08:01,640
see.

122
00:08:02,050 --> 00:08:08,440
So in say this class main activity fragment as you can see here in line number 61 We have actually an

123
00:08:08,590 --> 00:08:14,480
array of linearly outs and the name of this area is rows of guest.

124
00:08:14,490 --> 00:08:16,570
Hence in animalcules.

125
00:08:16,690 --> 00:08:17,710
Right.

126
00:08:17,710 --> 00:08:19,790
So we actually declare this error here.

127
00:08:19,840 --> 00:08:25,610
And this right here is going to actually hold the number of rows that we are going to have.

128
00:08:25,720 --> 00:08:28,080
As you can see here this is going I should hold.

129
00:08:28,090 --> 00:08:28,890
Excuse me.

130
00:08:28,920 --> 00:08:33,500
This is going to hold the guess the rows that we are going to have inside our quiz.

131
00:08:33,520 --> 00:08:36,070
So as you can see here we have these two rows here.

132
00:08:36,070 --> 00:08:39,630
So this area is going to actually hold these two rows right.

133
00:08:39,820 --> 00:08:44,960
So we created an array here in order to actually hold these two rows here.

134
00:08:45,190 --> 00:08:51,670
So now let's actually go back into our Android studio and let's scroll down here and let's actually

135
00:08:51,670 --> 00:08:57,220
go inside our method and as you can see here let's look at our full up here as you can see now we are

136
00:08:57,220 --> 00:09:01,660
actually the inside is show next animal Mefford and we are looking at this for a loop here.

137
00:09:01,840 --> 00:09:03,820
So let's actually look at this unfold here.

138
00:09:03,840 --> 00:09:07,750
As you can see so the rows of spottiness in animal animalcules.

139
00:09:07,750 --> 00:09:10,740
So this is actually an array of linearly outs.

140
00:09:10,750 --> 00:09:16,160
OK this is an array that actually holds that linearly or else that we have inside our quiz.

141
00:09:16,500 --> 00:09:18,060
So guess.

142
00:09:18,340 --> 00:09:19,760
As you can see here.

143
00:09:19,780 --> 00:09:25,960
So in this way I can actually access specific specific So for example the first value is actually zero

144
00:09:25,960 --> 00:09:26,290
right.

145
00:09:26,290 --> 00:09:31,690
So for the initial value that we assigned to this row here is the zero.

146
00:09:32,050 --> 00:09:33,910
And here it going to actually go.

147
00:09:34,050 --> 00:09:37,630
So now as you can see here the value of this variable is zero right.

148
00:09:37,630 --> 00:09:42,160
So it's going to go inside this Arev and it's going to go inside the index zero of this outbreak.

149
00:09:42,250 --> 00:09:49,540
So as you can see here this row here is actually the index is the linear layout that is inside of the

150
00:09:49,540 --> 00:09:56,170
index 0 of these are a rules of guess buttons in the milkweeds dot get child count.

151
00:09:56,380 --> 00:10:01,910
So if you look at this low here as you can see the children of this throw is these are these buttons

152
00:10:01,930 --> 00:10:02,880
as you can see here.

153
00:10:02,920 --> 00:10:09,400
This is this first button and the second button so that each child count of this linearly out here is.

154
00:10:09,580 --> 00:10:12,590
Have two buttons inside this linearly out.

155
00:10:12,640 --> 00:10:19,010
So we have the method get child Chalte get child count is going to return the value to number two.

156
00:10:19,330 --> 00:10:24,530
So those of guess what ends in animalcules a row that get child count.

157
00:10:24,550 --> 00:10:31,510
So here it's going to actually execute this inner for loop here until the value of this column is less

158
00:10:31,510 --> 00:10:37,790
than the value of the child count of these rows of spottiness in animalcules Sobero.

159
00:10:38,020 --> 00:10:38,830
OK.

160
00:10:39,310 --> 00:10:45,100
And then as you can see here finally I am actually specifying that after each execution of this for

161
00:10:45,110 --> 00:10:49,900
loop here it's going to actually increment the value of this column variable by 1.

162
00:10:49,900 --> 00:10:55,510
So let's actually go inside this for a loop here and let's see what's going on here in line number three

163
00:10:55,510 --> 00:10:57,310
hundred and sixty four.

164
00:10:57,310 --> 00:11:01,830
I actually created a button and the name of this button is PTEN gets.

165
00:11:01,960 --> 00:11:09,240
And then I put an assignment operator here and that I actually tested this article to a button object

166
00:11:09,690 --> 00:11:18,360
and I actually fed to this at a loss of just spottiness in animalcules sup role that get child X column.

167
00:11:18,480 --> 00:11:20,960
So it's going to actually access for example.

168
00:11:20,970 --> 00:11:23,930
Now as you can see the row is 0 and the column is 0.

169
00:11:23,970 --> 00:11:26,670
So it can actually go inside this linearly out.

170
00:11:26,670 --> 00:11:32,310
This is actually the first linear left right and it's going to actually look at the first the first

171
00:11:32,310 --> 00:11:34,610
color and so is Aunt button.

172
00:11:34,650 --> 00:11:39,930
And as you can see is the first column and then it's going to assign that value to the city and guess

173
00:11:40,260 --> 00:11:40,900
so.

174
00:11:41,010 --> 00:11:44,790
Now for example we are actually referring to this on button here right.

175
00:11:45,120 --> 00:11:47,690
And that he had and guess that set in a belt.

176
00:11:47,700 --> 00:11:48,810
True.

177
00:11:48,990 --> 00:11:54,870
And as you can see here I am actually going to enable this spot and so each question that we're going

178
00:11:54,870 --> 00:11:58,920
to show to the user We're going to actually enable the buttons.

179
00:11:58,920 --> 00:12:04,830
As I told you in the previous serials when the user is actually guessing the name of the animal for

180
00:12:04,830 --> 00:12:07,150
example here the name of the animal is on the right.

181
00:12:07,260 --> 00:12:13,140
Now all of these buttons are going to be disabled and after you're going to show to the user the next

182
00:12:13,140 --> 00:12:17,260
question we need to actually make those buttons enable again.

183
00:12:17,420 --> 00:12:17,950
OK.

184
00:12:18,060 --> 00:12:19,260
So here we have fish.

185
00:12:19,260 --> 00:12:21,430
Now all these buttons are disabled.

186
00:12:21,690 --> 00:12:26,970
And again when I want to show the next question to the user that will we need to actually make all these

187
00:12:26,970 --> 00:12:29,760
buttons actually enabled.

188
00:12:30,030 --> 00:12:33,520
So that's why we actually created these four loops here.

189
00:12:33,810 --> 00:12:40,080
And then here as you can see I actually created a variable of type string and the name of this variable

190
00:12:40,080 --> 00:12:42,300
is animal image name.

191
00:12:42,480 --> 00:12:45,240
And then I put an assignment operator here.

192
00:12:45,540 --> 00:12:53,670
And as you can see here all animals names least that get and now as you can see here inside the prentices

193
00:12:53,970 --> 00:12:57,270
we have actually an operation inside these practices.

194
00:12:57,270 --> 00:13:01,800
We have another prentices and inside these Prentice's as you can see here I am actually multiplying

195
00:13:01,800 --> 00:13:07,220
the value of this row by two plus column.

196
00:13:07,240 --> 00:13:11,710
So the result of this operation here is going to be added to this column.

197
00:13:11,770 --> 00:13:18,090
So now I want to actually touch more about this line of code here because this is a very important point.

198
00:13:18,130 --> 00:13:22,000
This is actually are very important concepts concepts that you need to know.

199
00:13:22,300 --> 00:13:25,580
And then let's actually talk more about this line of code here.

