Hello, friends today.
I just go for a gamble game example in LabVIEW for that purpose you just need a.
Dies first because on a dice we have a number from 1 to 6 mentioned.
So I just go for random number.
It will generate the numbers between 1 to 6.
So for that purpose I just make upper bound.
To six and lower bound.
To one.
So it will give me numbers between 1 to 6.
Over here.
We just got that number.
So just create.
Indicator over here.
This will give you the current number.
Current number and in this case, when there is a.
We just compare our number with.
The current number, so just use comparison this value.
Current number value should be equal to the number that is placed by user.
So create a control over here so it will give you the number.
By user.
Okay, so over here we have number by user and the current number when both are equal.
In that case it will stop my loop.
I'm just using while loop just connect it.
And I also want to know that after how many loops I just got this.
Comparison.
Equal means minus the number by user equal to is equal to the current number.
So let's create a indicator over here.
In that case because the iteration will start from zero.
I just go for a.
Increment.
By one function.
So it will give me after how much value I got.
The comparison equal means the number selected by the user.
It is equal to the current number that is generated by the dice in how many after how many cases it
will.
Generate my given number.
So over here.
Match.
So just go to your front panel.
Or here we just put number by user and this is my current number.
Let's convert this function to a more attractive way.
So just go to.
Numeric.
And over here, I'm just using a meter in place of this and the maximum value is six and minimum value
is one because these values are generated by my random number.
Or you can say by the dice.
Okay.
And over here.
Match.
I'm just using again.
Different function.
So let's say I'm just using Gauge over here.
It will show me after how many cases I just matched with the dice number.
So again, this is my.
Uh, cases may be anyone.
Let's say it is up to 100.
Or it may be more than 100.
And over here, I just put my number.
I just increase the size.
Let's say I'm selecting five.
Let's check after how.
Many cases.
I just got this number five through this dice, these 1 to 6 1.5.
It is not possible in this case, so make it smaller.
So when I just hit on run button.
As you see or hear input number is five.
It is equal to five.
Let's check just make a digital display over here.
After five cases, I just got the number five again when I hit on run button.
After 24 cases.
I just got the number five.
Right now after three cases, I just got the number five.
Again.
In the first case, I got the number five from the dice.
This is how you can create a gambling game through your labview.
If you want to just go for more numbers or more cases, just this is for this is the case for a dice.
Just save it.
Dice game.
Because in this case, we have only single dice.
If you want to go for multiple dice, you just go for multiple dice.
In that case, let's say on the one dice, I just got five.
On the second dice, I just want or you just want a combination of two dice.
In that case, you just create two dice and the combination of these two dice will generate a signal
that will stop your loop.
In the next video, we will just go for that case.
So for today.
This is all about.
Thank you.