I have had this problem for a while and can't seem to find anything that works. How would I get it so that currentspace is increased by the total amount rolled.
def roll():
import random
doubles = 0
x = random.randint(1, 6)
y = random.randint(1, 6)
print(x, y)
if x == y:
print('Doubles')
doubles = 1
print(f'You have rolled {doubles} doubles!')
x1 = random.randint(1, 6)
y1 = random.randint(1, 6)
print(x1, y1)
if x1 == y1:
print('Doubles')
doubles = 2
print(f'You have rolled {doubles} doubles!')
x2 = random.randint(1, 6)
y2 = random.randint(1, 6)
print(x2, y2)
if x2 == y2:
doubles = 3
print(f'You rolled {doubles} doubles!')
print('Go to Jail!')
else:
total2 = x + y + x1 + y1 + x2 + y2
print(f'You rolled {total2} in total.')
else:
total1 = x + y + x1 + y1
print(f'You rolled {total1} in total.')
else:
total = x + y
print(f'You rolled {total} in total.')
currentspace = 0
print(roll())