1
00:00:00,750 --> 00:00:04,770
So now let me actually show you what's going on here.

2
00:00:04,770 --> 00:00:05,340
Exactly.

3
00:00:05,340 --> 00:00:06,500
Exactly.

4
00:00:06,510 --> 00:00:10,150
So here are our application is actually running.

5
00:00:10,260 --> 00:00:13,080
And here are our image here.

6
00:00:13,080 --> 00:00:21,420
So now as you can see here are when I click on this image it's going to actually execute these lines

7
00:00:21,420 --> 00:00:24,530
of code here inside of the set and click listen on it.

8
00:00:24,690 --> 00:00:30,330
So now let's actually click on this image here and see what happens.

9
00:00:30,330 --> 00:00:34,270
You wrote four plus one is equal to five.

10
00:00:34,290 --> 00:00:41,240
So as you can see here first we actually created a value but an integer valuable some and we assigned

11
00:00:41,280 --> 00:00:44,000
the return value of the Smurfette with this valuable.

12
00:00:44,100 --> 00:00:44,480
OK.

13
00:00:44,610 --> 00:00:48,590
As you can see here first it's going to actually execute this method here.

14
00:00:48,600 --> 00:00:51,390
So let's actually go inside this let's roll the dice here.

15
00:00:51,390 --> 00:00:54,490
So just hold the command key and then click on the Smurfette.

16
00:00:54,510 --> 00:00:59,100
All you can actually if you are using a Windows machine you can actually call the control key and then

17
00:00:59,100 --> 00:00:59,640
click on this.

18
00:00:59,640 --> 00:01:01,350
Let's roll the dice Meffert.

19
00:01:02,040 --> 00:01:03,470
And now we are inside this.

20
00:01:03,480 --> 00:01:05,110
Let's roll the dice first.

21
00:01:05,130 --> 00:01:09,570
It's going to actually create an integer variable in a rant die one.

22
00:01:09,780 --> 00:01:17,130
And then this can actually generate an integer random number between number 1 and number 6.

23
00:01:17,460 --> 00:01:21,570
And then this can actually a sign that the truth is valuable into.

24
00:01:21,720 --> 00:01:22,230
One.

25
00:01:22,380 --> 00:01:23,280
OK.

26
00:01:23,820 --> 00:01:27,350
And then you actually created another integer variable.

27
00:01:27,510 --> 00:01:35,640
And again we assigned this random number that is actually between a random number between number 1 and

28
00:01:35,640 --> 00:01:41,620
number 6 and we are actually assigning that value to this random variable.

29
00:01:41,700 --> 00:01:42,850
OK.

30
00:01:43,470 --> 00:01:48,370
And here we created as an integer value but again caught some.

31
00:01:48,420 --> 00:01:53,650
And here I am assigning the sum of these two values to this variable.

32
00:01:53,930 --> 00:01:55,000
OK.

33
00:01:55,560 --> 00:01:57,620
So this takes you here.

34
00:01:57,630 --> 00:02:04,950
This takes viewers here that you can see are actually the result of executions of these of these lines

35
00:02:04,950 --> 00:02:05,520
of code here.

36
00:02:05,520 --> 00:02:06,150
OK.

37
00:02:06,570 --> 00:02:14,460
So here it says the calculations that said text string that formats all the calculations value plus

38
00:02:14,940 --> 00:02:22,780
you rolled as you can see this is the value you rolled personally plus percent the equal person the

39
00:02:23,120 --> 00:02:23,970
rand Tyvon.

40
00:02:23,990 --> 00:02:30,480
As you can see randomly one is number four and as you can see as you can see here ranked to is number

41
00:02:30,480 --> 00:02:36,890
one and the sum of these two variables and the sum of these two values is number five.

42
00:02:36,960 --> 00:02:37,730
OK.

43
00:02:37,980 --> 00:02:43,800
After executing the Smurfette it's going I should written this the value of the sum valuable to the

44
00:02:43,800 --> 00:02:44,410
caller.

45
00:02:44,430 --> 00:02:49,580
So who is the color the color of this method is in sight of this.

46
00:02:49,590 --> 00:02:50,300
Uncle.

47
00:02:50,410 --> 00:02:55,170
OK inside of this uncle Smurfette we called this let's roll the dice Meffert.

48
00:02:55,260 --> 00:02:57,250
So the caller is unclear.

49
00:02:57,300 --> 00:02:57,960
OK.

50
00:02:58,290 --> 00:03:05,340
And we assigned that value that somebody the value of that so valuable to these dice some value bet.

51
00:03:05,350 --> 00:03:05,810
OK.

52
00:03:06,090 --> 00:03:09,330
So now with the value of this day somebody's about is five.

53
00:03:09,900 --> 00:03:16,840
And here we are actually assigning the value of these TXI the calculations that take that view.

54
00:03:16,890 --> 00:03:24,000
So as you can see here these are the calculations based view and we are assigning that value to this.

55
00:03:24,000 --> 00:03:26,490
All the calculations value OK.

56
00:03:26,820 --> 00:03:30,490
So this line of code is actually now assigned to this.

57
00:03:30,500 --> 00:03:32,160
All the calculations value.

58
00:03:32,160 --> 00:03:32,960
OK.

59
00:03:33,420 --> 00:03:37,620
And here we actually assign the value 0 to the points value.

60
00:03:37,890 --> 00:03:41,400
And now it can actually go inside of the switch statement.

61
00:03:41,400 --> 00:03:42,030
OK.

62
00:03:42,330 --> 00:03:45,810
And then it's going to actually switch between the values of this song.

63
00:03:45,930 --> 00:03:49,020
So remember now the value of this sum is fine.

64
00:03:49,200 --> 00:03:49,720
OK.

65
00:03:50,010 --> 00:03:52,710
So case 7 11.

66
00:03:52,710 --> 00:03:54,670
So it is not the right case.

67
00:03:54,690 --> 00:03:56,190
Target Class 3.0.

68
00:03:56,190 --> 00:03:56,850
No.

69
00:03:57,060 --> 00:03:59,100
And here we can see the value 5.

70
00:03:59,670 --> 00:04:03,330
As you can see the value of our son is five.

71
00:04:03,450 --> 00:04:08,790
So if we can see this case here and so is going to try to execute these lines of code here these lines

72
00:04:08,790 --> 00:04:09,360
of code.

73
00:04:09,590 --> 00:04:09,920
OK.

74
00:04:09,930 --> 00:04:11,320
As you can see here.

75
00:04:11,400 --> 00:04:18,460
So now it's going actually assign this value status that proceed to these games that is valuable.

76
00:04:18,630 --> 00:04:24,240
So now the value of these games that is valuable is status that proceed.

77
00:04:24,240 --> 00:04:25,100
OK.

78
00:04:25,590 --> 00:04:30,190
And here we are actually assigning the value of these dice them to these points.

79
00:04:30,240 --> 00:04:30,870
OK.

80
00:04:31,050 --> 00:04:33,340
So the value of this day is five.

81
00:04:33,510 --> 00:04:38,010
So now we are actually assigning that value to the Trudy's points valuable.

82
00:04:38,070 --> 00:04:38,570
OK.

83
00:04:38,610 --> 00:04:45,210
Here we are actually saying 3x the calculations that said text all the calculations value as you can

84
00:04:45,210 --> 00:04:45,810
see here.

85
00:04:45,870 --> 00:04:48,120
This is this value this takes.

86
00:04:48,130 --> 00:04:50,070
Here is the value of this.

87
00:04:50,070 --> 00:04:57,480
All the calculations value OK Plus as you can see here we actually assigned that value to our variable

88
00:04:57,480 --> 00:04:57,910
here.

89
00:04:57,990 --> 00:04:58,980
OK.

90
00:04:58,980 --> 00:05:01,970
And here we are saying that plus your point is.

91
00:05:02,020 --> 00:05:03,330
So this is that text.

92
00:05:03,340 --> 00:05:06,620
Your point is called end points.

93
00:05:06,700 --> 00:05:13,290
So now as you can see because we assigned the value of this day some valuable to this our point's valuable.

94
00:05:13,360 --> 00:05:20,930
Here we are showing to the user that he's put his or her points is Phife and here we actually put a

95
00:05:20,950 --> 00:05:22,140
new line character.

96
00:05:22,270 --> 00:05:26,680
And here we said that the game status that it takes to continue the game.

97
00:05:26,860 --> 00:05:30,300
So this is that text and all the text the translations.

98
00:05:30,300 --> 00:05:35,330
Well you your point is plus points as you can see.

99
00:05:35,500 --> 00:05:40,590
Now these are valuable this RTX the calculations value.

100
00:05:40,630 --> 00:05:42,640
Now has this value.

101
00:05:42,780 --> 00:05:43,520
OK.

102
00:05:44,020 --> 00:05:47,230
We assign this value to the sportiest the calculations value break.

103
00:05:47,290 --> 00:05:51,450
And then it's going to break out of the switch statement and then it's going to reach this return statement.

104
00:05:51,450 --> 00:05:55,500
So it's going to actually break out of this entire unclick method.

105
00:05:55,600 --> 00:05:56,350
OK.

106
00:05:56,860 --> 00:06:02,250
So now we need to actually because we can actually continue the game.

107
00:06:02,320 --> 00:06:05,590
We can click on this image again here.

108
00:06:05,590 --> 00:06:09,400
So let's actually click on this image in order to see what happens.

109
00:06:09,760 --> 00:06:11,590
Your point is Phyfe.

110
00:06:11,650 --> 00:06:15,850
So this text here is the result of execution of this line of code.

111
00:06:15,850 --> 00:06:21,950
Here we said your point is plus points as you can see here and newline character.

112
00:06:22,000 --> 00:06:26,380
So we put this text here after this text this line of text here.

113
00:06:26,920 --> 00:06:32,390
And as you can see here now it says your point is five.

114
00:06:32,410 --> 00:06:37,990
So when we actually clicked on that image image view going to actually go inside this and click my foot

115
00:06:38,050 --> 00:06:38,840
again.

116
00:06:39,160 --> 00:06:43,360
And then it's going I tried to check this condition if game status is equal to status that not started

117
00:06:43,360 --> 00:06:43,640
yet.

118
00:06:43,660 --> 00:06:44,850
So it is false.

119
00:06:44,860 --> 00:06:45,370
OK.

120
00:06:45,580 --> 00:06:48,590
They get our game status is status that proceed.

121
00:06:48,610 --> 00:06:56,200
So it's going to actually go here and then it can execute these lines of code here if game status that

122
00:06:56,320 --> 00:06:57,460
status that proceed.

123
00:06:57,460 --> 00:07:01,400
So it is true this condition is true in dice.

124
00:07:01,480 --> 00:07:02,610
Let's roll the dice.

125
00:07:02,770 --> 00:07:05,380
It's going to actually again roll the dice for us.

126
00:07:05,380 --> 00:07:06,880
So it's going to actually go inside this.

127
00:07:06,880 --> 00:07:11,680
Let's roll the dice and then it's going to actually execute these lines of code.

128
00:07:11,680 --> 00:07:14,960
Here again your point is five.

129
00:07:14,980 --> 00:07:21,150
And as you can see here it says this value is our old value OK.

130
00:07:21,160 --> 00:07:23,430
Number five the value of the dice.

131
00:07:23,530 --> 00:07:24,120
OK.

132
00:07:24,430 --> 00:07:26,990
It's going I should execute these lines of code here again.

133
00:07:27,040 --> 00:07:31,310
So this time the value of this rant is number one.

134
00:07:31,420 --> 00:07:36,650
Randall Vaughn is number one and the value of this random two is number six.

135
00:07:36,670 --> 00:07:39,870
So are some of these two values is number seven.

136
00:07:40,120 --> 00:07:40,750
OK.

137
00:07:40,990 --> 00:07:43,830
And it says you rolled one plus six seven.

138
00:07:43,900 --> 00:07:44,500
OK.

139
00:07:44,890 --> 00:07:49,920
And then he's going to return the sum the value of the sum valuable to the caller.

140
00:07:50,060 --> 00:07:58,650
OK so now let's actually go back here and here we are saying that if dice some OK the value dice the

141
00:07:58,810 --> 00:08:00,160
sum is now seven.

142
00:08:00,160 --> 00:08:00,750
OK.

143
00:08:00,940 --> 00:08:04,610
If those is equal two points the value of these points are valuable.

144
00:08:04,630 --> 00:08:11,160
So our point is five and dice some the value of these dice and variable is not equal to 5.

145
00:08:11,200 --> 00:08:17,200
So it's going to actually skip this if statement here and then and then it can actually reach this if

146
00:08:17,200 --> 00:08:18,270
statement here.

147
00:08:18,580 --> 00:08:23,490
As you can see here it says else if dice sum is equal to seven.

148
00:08:23,500 --> 00:08:26,220
So as you can see here now Tyson is 7.

149
00:08:26,230 --> 00:08:31,360
So this condition evaluates to true and then this can actually execute these lines of code inside of

150
00:08:31,360 --> 00:08:31,640
these.

151
00:08:31,670 --> 00:08:32,110
Else.

152
00:08:32,180 --> 00:08:36,250
Else if statement game status is equal to status that last.

153
00:08:36,280 --> 00:08:41,420
So the they use their last game to the game status that said text you lost.

154
00:08:41,470 --> 00:08:44,770
As you can see here match I enjoy is invisible.

155
00:08:44,830 --> 00:08:50,490
So we cannot see that dice image here any more match between real start in visible.

156
00:08:50,680 --> 00:08:54,150
So we can see this restart the game button here again.

157
00:08:54,250 --> 00:08:55,100
OK.

158
00:08:55,930 --> 00:08:58,180
So that was the flow of this program.

159
00:08:58,210 --> 00:08:59,870
So hopefully that makes sense.

160
00:08:59,980 --> 00:09:00,960
Ok everyone.

161
00:09:00,970 --> 00:09:05,650
Now we want to talk about two important points about this project.

162
00:09:05,650 --> 00:09:08,560
First of all as you can see here we've got these cases here.

163
00:09:08,560 --> 00:09:09,170
OK.

164
00:09:09,430 --> 00:09:13,930
So instead of these cases I could just comment out these cases.

165
00:09:13,930 --> 00:09:21,100
Let me just comment on these cases here and instead I could just type in default colon and here as you

166
00:09:21,100 --> 00:09:24,340
can see this the file is the same as just writing.

167
00:09:24,340 --> 00:09:25,710
These are cases here.

168
00:09:25,750 --> 00:09:26,420
OK.

169
00:09:26,680 --> 00:09:28,990
So as you can see here inside this.

170
00:09:29,080 --> 00:09:30,360
Let's roll that Smurfette.

171
00:09:30,370 --> 00:09:36,220
As you can see of these so valuable is actually the value between number one and number two.

172
00:09:36,250 --> 00:09:36,880
OK.

173
00:09:37,120 --> 00:09:43,270
So as you can see here this piece of code here generates a random number between number 1 and number

174
00:09:43,270 --> 00:09:44,180
6.

175
00:09:44,230 --> 00:09:48,430
And this piece of code here is going actually to generate a random number between number one and number

176
00:09:48,430 --> 00:09:48,750
six.

177
00:09:48,770 --> 00:09:55,990
OK so the sum of these two values is going to be of value or random value between number 1 and number

178
00:09:55,990 --> 00:09:56,460
12.

179
00:09:56,530 --> 00:09:57,240
OK.

180
00:09:57,700 --> 00:10:05,380
So here as you can see inside of the switch statement we change some of these conditions and these are

181
00:10:05,380 --> 00:10:06,580
the default conditions.

182
00:10:06,580 --> 00:10:10,180
Case 5:55 case 8 case 9 and case then.

