Spoiler
However, according to the simulation, the player winning 100% of his games! I'm not quite sure why this is happening. Here is the piece of my script where all of the simulations are taking place:
def simulateGames(numOfGameSim):
numOfWins = 0 # Set Win Count to 0
# Simulate 'n' games
for i in range(numOfGameSim):
# Simulate dice role
diceValue = random.randrange(2, 13)
initValue = diceValue
if initValue == 7 or 11:
numOfWins += 1
elif initValue == 2 or 3 or 12:
numOfWins += 0
else: # if game isn't decided in initial roll...
while diceValue != initValue or 7:
diceValue = random.randrange(2, 13)
if diceValue == initValue:
numOfWins += 1
else:
numOfWins += 0
# return the win count and the winning probability
return numOfWins, (float(numOfWins) / float(numOfGameSim))
I've checked through this function a dozen times, but I can't seem to locate any flaws. Does anyone have any ideas about what could be happening?

New Topic/Question
Reply



MultiQuote








|