<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>
<Below this line, add a link to the EXACT exercise that you are stuck at.>
<In what way does your code behave incorrectly? Include ALL error messages.>
<What do you expect to happen instead?>
im trying to simulate craps game, approximate a big number of rolls,
the program should in case of Pass(Won) in the first roll obatin a total of 7 or 11(Win).
if its 2,3 or 12 its lost
Any other total in the first roll becomes the point, in this case, in order for the roll to be won, the player must roll many times the 2 dices, get a new total = point, if total is 7, he looses.
in the end,
the program should execute success rate, number of games won and lost
number of games finishes with 1 and multiple rolls.
import random
number_rolls = 0
result = -1
point=0
print()
first-roll = int(input(âroll dice:â))
if first-roll <= 0:
print(âTerminĂ©â)
elif first-roll > 500000:
print(âToo bigâ)
first-roll = int(input(âplease try again:â)) # it should ask user to enter a number(roll)
else:
# print(âletâs start.â) edited
print(âletâs start.â)
while (result != first-roll):
result = random.randint(1,6)
number_rolls += 1
if result in {7, 11}: #won
print('Won')
elif result in {2, 3, 12}: # lost
print('lost')
else:
if result == 7:
print('lost')
while True:
if point == first-roll:
point += 1
print('won')
if point == 7:
print('lost')
point-=1
print(âthe roll wasâ, first-roll)
print(âwe did {0} lancer(s)before we get the first {1}â.format(result, first-roll))
print(âthe number of rolls devided by the first roll:â, format(number_rolls /first_roll, â8.6fâ))
print(âWon gamesâ, format(point))
print(âlost gamesâ,format(point))
print(âEndâ)
<do not remove the three backticks above>