The odds of rolling a Yatzee on a single roll of 5 dice is 1/1296. Write a C program that tests this. Test it 1000 times.
Ok so I tried to code it and found out I had no idea what to do. Tried few stuff didn't even came close. I'm new at this, its been a month I'm learning C. So it would be great is someone can help me. I dont want the whole code. A start, just give me scratch of a code, just to show me what to do. It will b a great help.
**I don't want the whole game code, just the test part. The probabilities.
**Algorithm that I kind of drafted
1. Intro msg
2. Ask the user if he wants to know the odds of rolling a Yatzee on a single roll of 5 dice.
3. Test the program 1000 times and display the result.
a. 5 dice randomly rolled
b. Keep track of how many times a dice has been rolled.
c. Keep rolling till it reached a Yatzee (mean time keep adding the rolls).
d. After reaching a Yatzee start over and execute the program 1000 times. (mean time keep track of how many times it took to roll a Yatzee on each account).
e. After running 1000 execution divide it by 1000 and the result should b close to the odd mentioned above.