So here as you can see in line number three hundred and fifty five we have actually a value of L which
is of type integer and the name of this variable is correct animal name index.
So I put an assignment operator here and then I referred to the name to the name of this list here.
All animals names list dot index of correct animals answer.
So here I have to actually get the index of the correct animal answer.
So as you can see here in say the Smurfette short and this animal here in line number three hundred
and fit a frailty as you can see I am actually assigning This next animal image name to describe animals.
And so in order to specify that what is going to be actually the correct answer.
Right.
So then in line number twenty nine I actually removed this value from the index zero of these all animals
names list and then I assigned this value to this valuable which is of types three in name.
Next animal image name in line number three hundred and fifty as you can see I am assigning.
Next animal image name to this correct animals answer.
So this valuable actually holds the correct answer of the current question.
So now let's look at this line of code here.
As you can see I am actually fairly new to the name of this list here.
All animals names list.
So that index of.
So now you want to actually get the index of these value correct.
Animals answer inside this list.
So the index is going to be an integer value right.
And then it's going to assign that value to the integer variable correct and and immortally index in
line number three hundred and fifty six.
As you can see we have actually a variable of type streams and the name of this variable is correct.
Animal name.
And then I put an assignment operator here and then I refer it to the name of this list all Alamance
names list dot remove.
So now I want to remove this value.
Correct animal name index.
Right.
So here as you can see I am actually the first I am actually getting the index of this value inside
this list right.
And that I am assigning that index to this value in line number three hundred and fifty six.
I am actually removing this value that is inside of this index inside this list.
So all animals names list that remove the value that is inside of this index.
Correct animal name index.
And then it's going to actually remove and then and then it's going to actually remove that value and
then it's going to assign that removed value to this correct.
And any money right.
So this string variable now holds that removed value that is inside of this index.
Correct.
And the name index and in line number three hundred fifty seven.
I actually again I think this value this all animal names list.
But this time this value correct animal name is going to be added to the last index.
So now let me explain again here in line number three hundred fifty five.
I am actually getting the index of the correct answer of the current question.
So now let me show you the emulator as you can see this is the emulator.
And here this is actually our current question.
So here we have an ant.
So let's look at this question.
And now as you can see here I am actually getting the correct answer.
The index of the correct answer in say the least.
So it's going to give us that in days and then it's going to actually sign that index to this variable
which is a finite integer in line number three hundred and fifty six.
As you can see we have actually a variable of type streams.
And the name of this variable is correct animal name.
Right.
And then I put an assignment operator here and then I referred to the name of this list.
All animals names list dot remove.
Now you want to remove this value that is inside of this index.
Correct animal name index and then it's going to actually assign that removed value to this correct
animal name.
And then in line number three hundred and fifty seven I want to actually add this correct animal name
to the last index of this all animal names list because of the reason that you were actually doing this
here.
I am actually removing this.
The correct answer.
The name of the correct animal name here from this list.
And then I am actually adding it.
Adding this value with the correct animal into this list because first I want to specify the other values
so as you can see here we have an aunt right.
So first you should actually specify the other options for example fish Chad bird right.
First I want to specify these values here.
And finally I can actually add the answer to this quiz.
OK.
I don't want to actually just randomly just put the answer here as an option.
First I want to specify the other options.
Fish for fish cats or bird and then at the end of the Smurfette you can see that you will see that we
are going to add the answer here by using another algorithm.
But in this way when we actually add the correct animal name to an index the last index of this list
in this way we are not going to for example actually by accident at the answer here between the options
between the guest buttons.
Right.
So first I want to be sure that the answer is not actually between the buttons.
And then I will actually substitute with the answer with another option.
So for now I just know that here that we are actually doing this.
Is that the reason that we're doing here is that because first I want to actually remove the value that
is inside of it that is inside of the index.
Correct answer.
And then of which we are going to add that value again to this list so that that value is going to be
added to the last index of this list.
And now let me actually talk about this for loop here.
As you can see.
So now let's look at this for love here.
As you can see if you have a full loop and inside the practices of this follow up as you can see we
have actually Avari about an integer and the name of this variable is a row.
And then I assigned the values 0 to this variable.
Right.
And then here I actually created a condition that actually determines that.
How many times this for loop here is going to be executed.
So until then I do have this low here is actually less than the value of this number of animals gets
lost here.
As you can see so this variable is going to actually specify that how many number of guests throws we
are going to have inside our quiz.
So now let me show you the emulator as you can see as you can see here we have actually to get through
the first year so is here that contains these two buttons on it and fish and the second.
So is this one that actually contains these two buttons.
The bird and the cat.
So and that he had finally here we are actually saying that after each execution of this for a loop
here we're going to add one value to the value of these row of idea.
So now as you can see here inside this for loop here we have another for loop as you can see here.
So this is actually on an inner for loop as you can see.
So let's look at this fall here.
So for it and here we actually created over the table and the name of this variable is column.
And then I assigned the value zero to this variable.
And here again we're actually creating a condition that actually determines that how many times this
follows here is going to be executed.
So until the value of this column variable is less than the value of the lows of guess bottoms in animal
animalcules.
So now let's actually scroll to the top here in order to show you with this variable here as you can
see.
So in say this class main activity fragment as you can see here in line number 61 We have actually an
array of linearly outs and the name of this area is rows of guest.
Hence in animalcules.
Right.
So we actually declare this error here.
And this right here is going to actually hold the number of rows that we are going to have.
As you can see here this is going I should hold.
Excuse me.
This is going to hold the guess the rows that we are going to have inside our quiz.
So as you can see here we have these two rows here.
So this area is going to actually hold these two rows right.
So we created an array here in order to actually hold these two rows here.
So now let's actually go back into our Android studio and let's scroll down here and let's actually
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
actually the inside is show next animal Mefford and we are looking at this for a loop here.
So let's actually look at this unfold here.
As you can see so the rows of spottiness in animal animalcules.
So this is actually an array of linearly outs.
OK this is an array that actually holds that linearly or else that we have inside our quiz.
So guess.
As you can see here.
So in this way I can actually access specific specific So for example the first value is actually zero
right.
So for the initial value that we assigned to this row here is the zero.
And here it going to actually go.
So now as you can see here the value of this variable is zero right.
So it's going to go inside this Arev and it's going to go inside the index zero of this outbreak.
So as you can see here this row here is actually the index is the linear layout that is inside of the
index 0 of these are a rules of guess buttons in the milkweeds dot get child count.
So if you look at this low here as you can see the children of this throw is these are these buttons
as you can see here.
This is this first button and the second button so that each child count of this linearly out here is.
Have two buttons inside this linearly out.
So we have the method get child Chalte get child count is going to return the value to number two.
So those of guess what ends in animalcules a row that get child count.
So here it's going to actually execute this inner for loop here until the value of this column is less
than the value of the child count of these rows of spottiness in animalcules Sobero.
OK.
And then as you can see here finally I am actually specifying that after each execution of this for
loop here it's going to actually increment the value of this column variable by 1.
So let's actually go inside this for a loop here and let's see what's going on here in line number three
hundred and sixty four.
I actually created a button and the name of this button is PTEN gets.
And then I put an assignment operator here and that I actually tested this article to a button object
and I actually fed to this at a loss of just spottiness in animalcules sup role that get child X column.
So it's going to actually access for example.
Now as you can see the row is 0 and the column is 0.
So it can actually go inside this linearly out.
This is actually the first linear left right and it's going to actually look at the first the first
color and so is Aunt button.
And as you can see is the first column and then it's going to assign that value to the city and guess
so.
Now for example we are actually referring to this on button here right.
And that he had and guess that set in a belt.
True.
And as you can see here I am actually going to enable this spot and so each question that we're going
to show to the user We're going to actually enable the buttons.
As I told you in the previous serials when the user is actually guessing the name of the animal for
example here the name of the animal is on the right.
Now all of these buttons are going to be disabled and after you're going to show to the user the next
question we need to actually make those buttons enable again.
OK.
So here we have fish.
Now all these buttons are disabled.
And again when I want to show the next question to the user that will we need to actually make all these
buttons actually enabled.
So that's why we actually created these four loops here.
And then here as you can see I actually created a variable of type string and the name of this variable
is animal image name.
And then I put an assignment operator here.
And as you can see here all animals names least that get and now as you can see here inside the prentices
we have actually an operation inside these practices.
We have another prentices and inside these Prentice's as you can see here I am actually multiplying
the value of this row by two plus column.
So the result of this operation here is going to be added to this column.
So now I want to actually touch more about this line of code here because this is a very important point.
This is actually are very important concepts concepts that you need to know.
And then let's actually talk more about this line of code here.