05-14-2021 12:50 PM
Hello
I want to simulate a dice, but the tricky part is that i want to stop it after a user defined number (between 1-6) appears a user defined number in a row. Does anybody know how i should do this?
I hope it make sense
- Michael
Solved! Go to Solution.
05-14-2021 01:00 PM - edited 05-14-2021 01:06 PM
Hi Michael,
@MSK97 wrote:
I want to simulate a dice, but the tricky part is that i want to stop it after a user defined number (between 1-6) appears a user defined number in a row. Does anybody know how i should do this?
Yes.
What have you tried so far and where are you stuck?
You know this forum is not intended to solve your homework!
05-14-2021 01:12 PM
Since you have only the "tricky part" left, can we assume that your dice simulation is finished otherwise? Do you have two controls, one to define the desired outcome number and one to define the number of occurrences in a row? Do you have a loop that repeats the trial until the condition is met? Do you have a mechanism to count the number of successive occurrences of the selected value? (hint: shift register!) Do you have a way to reset that number whenever the wrong dice number occurs? Do you have indicators for interesting statistics and updates to keep the user informed (e.g. for the total number of tries so far? the longest sequence so far? the total elapsed time? etc.).
Feel free to attach what you have accomplished so far and explain where you got stuck and we might be able to point you in the right direction.
05-14-2021 05:13 PM
Hi.
Thank you for your answer.
I am quite new to Labview, but i love to learn, and i actually like the program. I think i can finish the job, whenever i find a way to count the number of successive occurrences of the selected value.
To answer some of your question: Yes, i have a iteration counter and a time counter for how long it will take to finish the task. I have attached what i have so far. I know its not that good, but im learning 🙂
05-14-2021 06:02 PM
OK:
See how far you get. You are almost there!
05-16-2021 12:43 PM
05-17-2021 03:57 AM
Hi
Thank you very much. I made it with your explanation, so it doesnt quite look as good as yours, but im glad that i could make it 🙂
05-17-2021 12:14 PM
Just an FYI - "dice" is plural for "die". Strange, but true. ("Die" can mean about 400 different things. Yeesh.)
05-17-2021 12:53 PM
@billko wrote:
Just an FYI - "dice" is plural for "die". Strange, but true. ("Die" can mean about 400 different things. Yeesh.)
"The singular usage is considered incorrect by many authorities. However, it should be noted that The New Oxford Dictionary of English, Judy Pearsall, Patrick Hanks (1998) states that “In modern standard English, the singular die (rather than dice) is uncommon. Dice is used for both the singular and the plural.”
05-17-2021 01:26 PM
@altenbach wrote:
"The singular usage is considered incorrect by many authorities. However, it should be noted that The New Oxford Dictionary of English, Judy Pearsall, Patrick Hanks (1998) states that “In modern standard English, the singular die (rather than dice) is uncommon. Dice is used for both the singular and the plural.”
Tell that to every single child's game I have been playing for the last 6 years. I have yet to see "dice" refer to the singular in the instructions (yes, this is something I watch). It is always "throw the die."