Dice betting game with sound
You are to create a game of dice. The game works like this –
- The player rolls two dice
- If the dice have the same value (eg 2,2 or 5,5) then they win!
- If the dice do not have the same value they loose.
This is going to be a betting game. The user starts off with 400 points and can choose how much they want to get each time (between 1 and 50). The game will play like this –
- The user can choose to roll again or stop.
- If the user is out of money the game ends
- They can choose a bet amount between 1 and 50
- The dice are rolled
- If the player wins they get double the bet amount added to their money
- If they loose the bet amount is subtracted from the amount.
The game should use sound effects (as wav or wave files). You can use the winsound library
import winsound
winsound.PlaySound("test.wav", winsound.SND_FILENAME)
To help you can use the following code to get you started.
import winsound
import time
import random
print "The amazing dice game"
#http://www.bfxr.net/ use this website to generate sound effects
# this will play the sound. The sound MUST BE IN THE SAME FOLDER AS
# YOUR PYTHON FILE!!!
winsound.PlaySound("test.wav", winsound.SND_FILENAME)
time.sleep(4)
playAgain = True
money = 400
while playAgain == True and ????????:
# You need to write the lot yourself
print "you have ", money, "left"

You need to log in or create an account to submit code!











