Hello Guys,
I'm Uzay. I'm here to ask you something about Python. I want to write a programm about the game "Craps". This are the rules:
Quote:
o 1st roll, a score of 7 or 11 wins.
o 1st roll, a score of 2, 3, or 12 loses.
o 1st roll, any number other than those listed above becomes the goal number, you must keep rolling until you roll the goal number again. If a 7 is rolled before you goal number, you lose.
|
Here is the site for "Craps":
I have the basic code already written, I want to add now bet odds and my question is how and can you help me?
For information, I am using Python 2.5
Here is my code:
Quote:
LOST = 1
WON = 2
POINT = 3
dice1 = 0
dice2 = 0
sum = 0
last_throw = 0
status = 0
import random
print "Craps"
print "Welcome to the dice game Craps"
dice1 = random.randint(1,6)
dice2 = random.randint(1,6)
sum = dice1 + dice2
if sum == 7 or sum == 11:
status = WON
print "You Won"
else:
if sum == 2 or sum == 3 or sum == 12:
status = LOST
print "You lost"
else:
status = POINT
print "Continue"
print dice1, dice2, sum
while status == POINT:
print "New Litter"
dice1 = random.randint(1,6)
dice2 = random.randint(1,6)
sum = dice1 + dice2
print dice1, dice2, sum
if sum == POINT:
status = WON
print "You won"
else:
if sum == 7:
status = LOST
print "You lost"
else:
status = POINT
print "Continue"
|
Thanks for your help!
~Uzay