1
00:00:00,330 --> 00:00:04,230
So now let's actually look at all these lines of code here.

2
00:00:04,410 --> 00:00:11,290
So a low number 374 as you can see we have actually a variable of type Integer.

3
00:00:11,400 --> 00:00:13,610
And the name of this variable is zero.

4
00:00:14,040 --> 00:00:17,490
And here as you can see it refers to the name of this object.

5
00:00:17,490 --> 00:00:19,010
Secure random number.

6
00:00:19,140 --> 00:00:25,460
So they're actually the job of this object is to actually create a random number right.

7
00:00:25,470 --> 00:00:28,310
So set your random number the next event.

8
00:00:28,470 --> 00:00:35,700
So here is going to create an integer or random number for us from 0 to the value that we specify here.

9
00:00:35,700 --> 00:00:40,530
So secure random number that next int number of animals just rose.

10
00:00:40,560 --> 00:00:43,450
So now let me show you the emulator here.

11
00:00:44,670 --> 00:00:51,240
As you can see these are emulated right and now a number of animals just rules variable is going to

12
00:00:51,240 --> 00:00:59,430
hold the value that actually that is showing us the number of animals gets through.

13
00:00:59,520 --> 00:01:03,050
So for example as you can see we have to guess the rules here.

14
00:01:03,090 --> 00:01:07,230
The first one is here is this one that actually holds these two buttons.

15
00:01:07,230 --> 00:01:12,610
The first one is on it and the second one is horse and the second gets through here.

16
00:01:12,630 --> 00:01:18,390
This is what that second guess gastro that contains these two buttons the first button is flappy bird

17
00:01:18,690 --> 00:01:20,330
and the second button is penguin.

18
00:01:20,520 --> 00:01:23,110
So this number of animals gets through here.

19
00:01:23,120 --> 00:01:28,630
It's going to hold the number of the guests the rows that we have inside the quiz.

20
00:01:28,950 --> 00:01:37,110
So now I want to actually create I want to generate actually a random number between 0 and the number

21
00:01:37,110 --> 00:01:39,780
of animals just rows that we have here.

22
00:01:39,780 --> 00:01:45,490
So for example if you have actually to guess who's here right.

23
00:01:45,510 --> 00:01:52,980
So now it's going to actually generate a value of random value between 0 and 1 right between 0 and 2

24
00:01:53,010 --> 00:01:57,870
but not including number two because it's not going to include the final value.

25
00:01:57,860 --> 00:01:59,840
So for example here we have to get throws.

26
00:01:59,970 --> 00:02:06,120
So it can actually generate a random number between 0 and the number one is not going I should include

27
00:02:06,150 --> 00:02:07,570
the number two here.

28
00:02:07,740 --> 00:02:08,520
Right.

29
00:02:08,520 --> 00:02:14,060
So when we write to secure random number the next number of months gets throws it's going to actually

30
00:02:14,070 --> 00:02:19,720
generate a random number between 0 and this value here that we specify number of animals get through

31
00:02:19,720 --> 00:02:22,200
us but not including disvalue.

32
00:02:22,200 --> 00:02:24,660
So for example this value is too right.

33
00:02:24,690 --> 00:02:31,410
We have to guess throws so random that value that this object here is going to generate is actually

34
00:02:31,410 --> 00:02:33,530
a zero all number of what.

35
00:02:33,960 --> 00:02:37,160
So set your random number the next number of animals get through.

36
00:02:37,170 --> 00:02:41,470
It's going to generate a random value between a zero or number one.

37
00:02:41,490 --> 00:02:48,350
So and then it's actually a sign that randomly generated value which is often integer to this row of

38
00:02:48,360 --> 00:02:55,430
valuable so this variable is going to either hold the value at number 0 or the value number one.

39
00:02:55,570 --> 00:02:59,780
Right and then a line number 375.

40
00:02:59,790 --> 00:03:04,510
We have actually another variable and the name of this variable is column.

41
00:03:04,690 --> 00:03:11,170
And then I put an assignment operator here and now but again I want to actually generate another random

42
00:03:11,170 --> 00:03:16,190
value secure random number that next ain't two.

43
00:03:16,480 --> 00:03:24,570
So now I'm 100 percent sure that each row inside the crease has two columns.

44
00:03:24,580 --> 00:03:29,860
So as you can see here this through here has two columns as you can see here two buttons and so here

45
00:03:29,920 --> 00:03:34,730
is also has has also has actually two columns two buttons right.

46
00:03:34,780 --> 00:03:42,650
So I am 100 percent sure that I have actually two columns inside each row so secure random number next

47
00:03:42,710 --> 00:03:43,470
it to.

48
00:03:43,570 --> 00:03:48,460
So it's going I should again generate a random value between 0 and 2 but not including this value.

49
00:03:48,460 --> 00:03:49,120
Number 2.

50
00:03:49,270 --> 00:03:53,740
So it's going to either generate the value zero or devalue another one.

51
00:03:54,370 --> 00:04:00,070
So then it's going to actually assign that generated random value which is of that integers to this

52
00:04:00,070 --> 00:04:01,370
column variable.

53
00:04:01,630 --> 00:04:07,000
So this kind of variable is going to have either the value 0 or the value number one.

54
00:04:07,240 --> 00:04:13,690
And then let's look at this line of code here in line number three hundred and 76 linearly out random

55
00:04:13,690 --> 00:04:14,450
row.

56
00:04:14,860 --> 00:04:19,560
So now you may ask that what is the purpose of these lines of code here.

57
00:04:19,630 --> 00:04:26,680
The purpose of these lines of code is to actually a substitute one of the options of.

58
00:04:26,800 --> 00:04:28,170
Correct answer.

59
00:04:28,860 --> 00:04:35,580
So when we actually put these values here we are actually as you can see if you scroll to the top here

60
00:04:35,880 --> 00:04:42,260
we are actually specifying some randomly generated buttons someone randomly generated values for the

61
00:04:42,270 --> 00:04:48,710
guest options and we have not yet actually specified the actually the correct answer.

62
00:04:48,720 --> 00:04:53,950
We just generated these buttons with the random values but not including the answer.

63
00:04:54,000 --> 00:04:58,790
And that's why you can see that we actually removed that.

64
00:04:58,800 --> 00:05:03,430
The correct answer as you can see here in the look at these lines of what he really moved.

65
00:05:03,540 --> 00:05:08,030
The correct answer from the all animals named All animals are names at list here.

66
00:05:08,190 --> 00:05:14,840
And then we actually add it again that correct answer to that actually to the last index of these all

67
00:05:14,850 --> 00:05:17,230
animals named names here.

68
00:05:17,730 --> 00:05:23,330
And you can see that we actually generated these buttons with the values as you can see here.

69
00:05:23,700 --> 00:05:25,710
But our look at these lines of code here.

70
00:05:25,710 --> 00:05:32,040
Now I want to actually substitute one of the buttons with the correct answer.

71
00:05:32,040 --> 00:05:32,420
Right.

72
00:05:32,490 --> 00:05:37,280
So here as you can see look at this for loop here it is for loop here.

73
00:05:37,280 --> 00:05:42,440
It's going to actually generate four buttons with four different animal values.

74
00:05:42,450 --> 00:05:42,750
Right.

75
00:05:42,840 --> 00:05:44,850
But not the answer.

76
00:05:44,850 --> 00:05:46,110
So look at this flappy bird here.

77
00:05:46,110 --> 00:05:52,270
So it's going to actually put this flappy bird image here and we must guess the name of this animal.

78
00:05:52,320 --> 00:05:52,950
Right.

79
00:05:52,980 --> 00:05:59,010
But this for loop here is going to actually put four different animal names but not the answer because

80
00:05:59,010 --> 00:06:02,740
here we actually put the answer at the end of the list.

81
00:06:02,880 --> 00:06:04,610
And here as you can see here it is for Lapeer.

82
00:06:04,610 --> 00:06:08,550
It's going to actually just get the animal names from there.

83
00:06:08,580 --> 00:06:10,820
Actually the beginning of the list as you can see here.

84
00:06:10,950 --> 00:06:11,450
Right.

85
00:06:11,460 --> 00:06:17,070
If you look at these two lines of code here and if you just experiment with these two lines of code

86
00:06:17,070 --> 00:06:22,150
here you can see that you're actually getting the animal names from the beginning of the list.

87
00:06:22,170 --> 00:06:29,970
And here we actually added the animal named the correct animal name a tree that actually the last index

88
00:06:29,970 --> 00:06:30,910
of the list.

89
00:06:30,960 --> 00:06:36,940
And here as you can see we want to actually substitute one of the gifts options to be the correct answer.

90
00:06:37,080 --> 00:06:42,790
And that's why you want to choose the correct the randomly generated row as you can see here.

91
00:06:43,050 --> 00:06:48,440
And then I want to choose the randomly generated column and then here in line number three hundred and

92
00:06:48,450 --> 00:06:49,450
seventy six.

93
00:06:49,590 --> 00:06:55,050
As you can see I created a linearly out of a variable of type linearly out and the name of this but

94
00:06:55,120 --> 00:06:57,240
is a random row right.

95
00:06:57,270 --> 00:07:01,400
Assignment operator rows of just spottiness in animalcules.

96
00:07:01,410 --> 00:07:07,170
So this is actually an army that actually holds values of type linearly out right.

97
00:07:07,210 --> 00:07:10,890
So rows of spottiness in animal is Sub-Zero.

98
00:07:11,250 --> 00:07:13,080
So it's going to actually look at this area here.

99
00:07:13,080 --> 00:07:18,690
So now if I actually scroll to the top here inside this class you can see that we actually created this

100
00:07:18,950 --> 00:07:21,100
at a here in line number 61.

101
00:07:21,240 --> 00:07:26,670
So linear layout and array of linearly out as you can see here and then Aimee's loss of spottiness in

102
00:07:26,670 --> 00:07:27,940
animal cuius.

103
00:07:28,230 --> 00:07:34,650
And you can see that inside this uncreate view we actually initialized this out here as you can see

104
00:07:34,650 --> 00:07:36,300
here with these rows.

105
00:07:36,660 --> 00:07:41,010
But here if you scroll down here let's scroll down here and look at these lines of code.

106
00:07:41,010 --> 00:07:47,700
Here you can see that in line number three hundred and seventy six are referred to that are a.

107
00:07:48,090 --> 00:07:51,730
And I want to get our random row as you can see here.

108
00:07:51,750 --> 00:07:52,210
Right.

109
00:07:52,230 --> 00:07:54,590
So for example we have two rows here.

110
00:07:54,720 --> 00:07:58,490
I want to get that random blow for example Destro or the slope.

111
00:07:58,770 --> 00:08:04,070
And then here look at this line of code here in line number three hundred and seventy seven.

112
00:08:04,080 --> 00:08:08,910
So as you can see in this line of Cahir it can actually get a random group and it and then he's going

113
00:08:08,910 --> 00:08:13,390
to assign that random group to this random group variable here that we create here in like number three

114
00:08:13,390 --> 00:08:16,880
hundred and 376 in line number three hundred and seventy seven.

115
00:08:16,890 --> 00:08:22,200
We created another variable and the name of this variable is animal emergency.

116
00:08:22,320 --> 00:08:22,990
Right.

117
00:08:23,280 --> 00:08:30,250
And then I put an assignment operator here and I called the Smurfette get the exact animal name.

118
00:08:30,390 --> 00:08:34,330
And then I passed the correct animal's answer to this method.

119
00:08:34,590 --> 00:08:35,840
Right.

120
00:08:35,850 --> 00:08:42,560
So now as you can see here this variable here now holds the correct answer.

121
00:08:42,570 --> 00:08:47,970
So here we can actually change this name change the name of this variable to another value that is more

122
00:08:47,970 --> 00:08:48,780
meaningful.

123
00:08:48,780 --> 00:08:51,510
So correct animal image name.

124
00:08:51,600 --> 00:08:51,900
Right.

125
00:08:51,900 --> 00:08:55,780
So I can actually just type in here correct.

126
00:08:56,610 --> 00:08:58,620
Excuse me it's not capitalized.

127
00:08:58,890 --> 00:09:02,460
Correct animal image.

128
00:09:02,520 --> 00:09:03,500
As you can see here.

129
00:09:03,600 --> 00:09:04,970
Now it's more meaningful.

130
00:09:05,880 --> 00:09:11,950
And now this variable now holds the correct answer in line number three hundred and seventy eight.

131
00:09:11,950 --> 00:09:12,930
As you can see here.

132
00:09:13,120 --> 00:09:14,170
Look at this piece of code here.

133
00:09:14,260 --> 00:09:20,190
Look just look at this piece of code inside Apprentice's as you can see I am actually testing this object

134
00:09:20,200 --> 00:09:25,840
we bought an object I'm not creating a valuable here I'm just creating an object here.

135
00:09:26,260 --> 00:09:31,140
And as you can see I am referring to this random row here right.

136
00:09:31,150 --> 00:09:38,610
I'm referring to the random glue that get child at column right a random column as you can see here.

137
00:09:38,620 --> 00:09:39,270
Right.

138
00:09:40,500 --> 00:09:44,600
So random row that get tight at a column.

139
00:09:44,600 --> 00:09:50,680
So this column you have now holds a random value between zero and number one as you can see here.

140
00:09:51,260 --> 00:09:54,590
Dot as you can see here that set text.

141
00:09:54,590 --> 00:10:00,380
So here because we actually tested this value to a button object I can call this method and this value

142
00:10:00,380 --> 00:10:10,910
here as you can see right dot set text correct animal image name correct animal imagery and that's how

143
00:10:11,240 --> 00:10:17,640
I can actually substitute one of the gifts options with the correct answer.

144
00:10:17,660 --> 00:10:23,170
So it's going to actually look at one of the random rows and it's going to actually get one of the columns

145
00:10:23,170 --> 00:10:25,700
are randomly selected column as you can see here.

146
00:10:25,820 --> 00:10:30,530
And then it's going to actually call this effect on this value because we actually tested this value

147
00:10:30,530 --> 00:10:35,330
here to add but an update as you can see here we can call this method on this here.

148
00:10:35,360 --> 00:10:36,960
So our set takes.

149
00:10:37,040 --> 00:10:37,760
Correct.

150
00:10:37,820 --> 00:10:38,590
And in one image name.

151
00:10:38,600 --> 00:10:43,410
So now it's going to be set to one of the set that takes up one of the options.

152
00:10:43,490 --> 00:10:46,690
One of the options with the correct and emoluments name.

153
00:10:47,300 --> 00:10:50,300
So hopefully that makes sense.

154
00:10:50,440 --> 00:10:54,380
And now we need to actually create some other MFX here inside this class.

