And here as you can see I am referring to the name of this valuable plus.
Your point is points.
I am referring to the name of this variable in order to out with this value to the screen plus a new
line character thinks the game status that set text to continue the game.
All t actually triangulations you.
Your point is points.
OK and here I am assigning this value.
This points this string where the truth is all the calculation value.
So that the user can see the points of his or her game or tape of his or her game.
This return statement here is saying that the application is not allowed to execute the lines of code
after after this return statement.
Ok so I am putting this written statement inside of this if statement here.
OK so if the flow of the application and here is this if statement after executing these lines of code
here OK.
It's going to lead to this line of code here that says return.
And this means this return is actually like a break statement it's going to actually break out of this
method.
Out of these unclick method.
OK it's not going to actually execute the lines of code.
After this return statement.
OK and then it's going to actually break out of this uncle's method so that the user need to actually
click on DS.
I am GITTOES again in order to execute some other lines of code here.
OK.
And this return statement remember.
Means break out of that method.
OK you can use this return statement in all of your methods.
If in some circumstances you want to actually break out of that if it's OK.
So let's actually continue adding some more lines of code so that it will be more meaningful for you
and it will make sense.
Ok so after this and then curly brace of this if statement as you can see we have an if statement here.
OK so after this end in curly brace of this statement let's actually continue adding some more lines
of code here.
OK and here still we are inside of this unclick uncle Meffert as you can see here.
OK after this statement here let's actually create another if statement if game status is equal status
that proceed that proceed.
So now let's actually create an integer variable.
Int dice.
Some assignment operator Let's roll the dice again.
I am trying to actually assign the return value of this method to this variable.
OK.
And here let's actually create and if else statement.
If dice sum is equal two points ok.
If the value of the dice some variable is equal two points here gain status assignment operator status
that one the user wins the game takes the game status that said to set text you want and here let's
actually make this I enjoy dice invisible and let's actually make the leap between restart with the
bell.
OK.
And then let's actually create an ELSE IF statement here as if dice sum is equal.
Remember this double equals operated is the equal operator.
Else if dice sum is equal to 7.
Here I am referring to the name of that constant 7.
OK then game status is equal to status.
That's last.
So this means the last game.
And here I can't just typing DX the game status that said text.
And then inside Apprentice's I can just type in your last OK and then let's actually make this r i g
Jesus invisible OK.
And let's make the restart button visible between restart.
Visible.
OK.
So hopefully that makes sense.
So let me actually explain this block of code here again here.
I am actually creating an if statement and I am saying that if the value of this game status variable
is equal to status that proceed.
So remember when it when the flow of the program reaches two these are case statements here.
As you can see the status of the game is status that proceed and then it's going to actually reach this
line of code.
And then it's going to break out of this method.
OK.
It's not going to actually execute.
These are lines of code here anymore.
So the user need to actually click on this image one more time.
And when it when the user clicks on this image one more time is going to actually check this condition
again if game status is equal to status that not started yet.
So this condition is not true.
So it's going to actually start to execute these lines of code here.
Game status is equal to status that proceed.
That's right.
OK.
Here we actually put this value to the game status.
So it's going actually to execute these lines of code here.
Here I am actually creating an integer variable into this sum and that I am assigning the return value
of the Smurfette which is valuable.
And here I am saying that if the value of this by some value is equal to value of this point's valuable
then game status is equal to a status that one takes the games that is that set text you've won.
Maybe I and GITTOES invisible.
Maybe it's bit and visible.
So hopefully these lines of code make sense to you.
And here I am saying that if the value of this though some value is equal to 7.
OK so remember the value 7 here is assigned to this constant.
OK and here I am saying that if else if the value of the stay so valuable is equal to 7 then game status
is equal to that is not lost.
So the user loses.
Lost the game and here I am assigning this value to the sticks the game status makes.
I am Judo's invisible and make between a start.
Visible.
OK so hopefully that makes sense in sight of this uncreate method after the end the curly brace that
is actually related to the set and click listener of this I ended dice here.
I want to actually refer to the name of the city and restart the game.
That said on click listener new view that unclick listener and here I can actually put the lines of
code that are actually related to the uncle listener of this PTEN restart game.
OK so here I am just typing.
Game status is equal to status but not started yet th's the game status that set text to double quotes
TXI the calculations that said text to double quotes and all.
All it takes the calculations value assignment operator to double quotes.
As you can see I am assigning an empty value an empty string value to these variables.
OK and then I can actually make the IMJ dice visible OK and make the restart button invisible.
PTM restart invisible.
OK when the user clicks on this restart the game button is going to actually execute these lines of
code here.
First of all it's going to assigned a value status that not started yet.
To these games that is valuable and then it can actually assign the empty value to these takes the game
start and then it's going to assign the value is empty value to this to the calculations and then it's
going to actually assign this empty value to this.
All the calculations value and then it's going to make this.
I N G dice visible and make BT or restart invisible again.
OK so let's actually run our project and let's see how our game is actually running ok.
Use the same device for future launches.
OK so as you can see here are actually the our application is actually running on this emulator so let's
actually click on this image here in order to start the game.
So it says you rolled 6 plus free equals number nine.
Your point is number 9.
Continue the game.
So let's actually click on this image again.
You won.
So our point is number 9 and we rolled four plus five.
Number nine.
So because these were these two values are actually equal equal to each other.
So we won the game.
Let's restart the game and then let's actually click on this image here.
You wrote 1 plus 2 free you lost.
OK.
Because we actually because the value of this dice sum is free.
We lost the game.
Let's restart the game.
Click on this image.
You wrote four plus five nine.
Your point is nine.
Continue with the game.
Your point is nine.
You roll two plus five.
Seven.
OK.
Because the value of these dice here is seven.
We lost the game.
So now we can actually restart the game and continue playing this game.