I have an assignment were I had to make a dice game. Well I finally go the program and now he wants percentages and more of the dice game played 20000 times. I'm not sure where to start but i know i need a for loop.
Here is what he wants:
After your program can play the game once correctly, add a loop so that it plays the game 20000 times. Add counters that count how many times the player wins (and where), and how many times the player loses. Post your answers on the Discussion board as soon as you get them.
3.1 After the 20000 games, compute the percentage of times the player will win. Output this value.
3.2 What is the percentage of times the player will win on the first roll? Output this value.
3.3 What is the percentage of times the player will win by rolling a 7 in the second part of the game? Output this value.
Put everything between lines 9 and 50 in a for loop counting from 0 to 20000. Instead of printing out that the player won or lost, increment a counter each time (you'll need one counter for wins and one for losses).
% times player wins == win / 20000
You'll need two more counters for the other two things you need to check.
Remove all of your print functions before you test this. They can really slow down a program.