NOTE--- this is the 2nd time posting this program on here. The first didn't work.
Overview
Your club is running an online casino night to raise money for a local charity. You have been asked to create a program to simulate a game of craps.
Implementation
Create a python program that prompts the user for input, simulates the outcome of a dice roll (2 6-face die), applies a set of rules, calculates and displays the results to the user. The user will be asked if they want to roll again or stop play
Business Rules
Craps is a betting game based on the roll of dice. The dice are made up of two game pieces. In this mini-project, you will create a program to play craps by simulating the roll of two 6-sided dies and evaluating the results. The result is based on the total of the dice. For example, if the roll is a 2 on die one and 3 on die two, the result (win, lose or roll again) is based on the total of 5. The rules are as follows:
1. Roll One
Total Of The First Roll
|
Result
|
7 or 11 |
You Win |
2, 3, or 12 |
You Lose |
4, 5, 6, 8, 9, 10 |
Roll Again |
2. Roll Two: If on the first roll, the shooter rolls a combined 4, 5, 6, 8, 9, or 10, that number becomes the "point" and is the target for all subsequent rolls. To determine a winner, the shooter continues rolling until either the "point" is rolled again and you win or a 7 is rolled and you lose.
Total of the 2nd and subsequent rolls
|
Result
|
7 |
You Lose |
Point (sum of roll one = 4, 5, 6, 8, 9, 10) |
You Win |
Any other number |
Roll Again |
The program should:
- Ask the user how much they want to bet and save this value to the variable BetAmount.
- Simulate the first roll of the dice using the import Random.
- Display the result of the first roll and, based on the roll, display one of the following:
"You rolled a " + DiceTotal + " and won $" + BetAmount + ". Do you want to play again (y/n)?"
"You rolled a " + DiceTotal + " and lost $" + BetAmount + ". Do you want to play again (y/n)?"
"You rolled a " + DiceTotal " + ". Press the Enter key to roll again
4. If the user was prompted to roll again and rolls a 7, display:
"You rolled a " + DiceTotal + " and lost $" + BetAmount + ". Do you want to play again (y/n)?"
If the user was prompted to roll again and rolls the "point", display:
"You rolled a " + DiceTotal + " and won $" + BetAmount + ". Do you want to play again (y/n)?
5. Continue looping the program until the user typesn when asked if they want to play again. Keep track of the number of games played and amount of money won and lost and display the results to the user when they stopplaying such as:
"You played " + NumGames + " games and " + WonOrLost + " a total of $" + AmountWonOrLost
6. If you have a running program, test your program by creating at least 5 program runs. Each run should capture the program display similar to this craps result display.
Please Answer this Question after program is done
1. Draw a diagram or pseudocode of the solution.
2. Does the program runs as expected and why?
3. If you have a running program, test your program by creating at least 5 program runs. Each run should capture the program display similar to this craps result display.