Having trouble with the final loop in this craps program. Any suggestions.
Problem starts on line 28.
Was thinking about breaking the whole thing into functions but I don't exactly know where to call them at. When I do call them I get accessed before argument errors or something to that affect.
Could someone also tell me if there is a way to print spaces without hitting the space bar? Wanted to center the word craps.
import random
def main():
going = 'y'
while going == 'y' or going == 'Y':
print '*' * 30
print' CRAPS'
print '*' * 30
raw_input('Press "Enter" to roll the dice')
die1 = random.randint(1, 6)
die2 = random.randint(1,6)
roll = die1 + die2
if roll in [2,3,12]:
print die1, die2
print 'You lose'
going = raw_input('Play again "y" for yes: ')
elif roll == 7 or roll == 11:
print die1, die2
print 'You win'
going = raw_input('Play again "y" for yes: ')
elif roll in [4,5,6,8,9,10]:
print die1, die2
print 'You must get a',roll,'to win'
raw_input('Press "Enter" to roll the dice')
while roll == roll:
##I tried putting everything under the sun in that while loop.
die3 = random.randint(1, 6)
die4 = random.randint(1, 6)
roll2 = die3 + die4
print roll2
if roll == roll2:
print 'You Win!!!'
going = raw_input('Play again "y" for yes: ')
elif roll2 == 7:
print 'You loose'
going = raw_input('Play again "y" for yes: ')
main()