Skip to content

Instantly share code, notes, and snippets.

@Mohamed2del
Created October 19, 2018 21:45
Show Gist options
  • Save Mohamed2del/e60859d5305f35c8244b1c0abc37b445 to your computer and use it in GitHub Desktop.
Save Mohamed2del/e60859d5305f35c8244b1c0abc37b445 to your computer and use it in GitHub Desktop.
In the Empire State Building bet, your next move depends on the number of eyes you throw with the dice.
# Numpy is imported, seed is set
# Starting step
step = 50
# Roll the dice
dice = np.random.randint(1,7)
# Finish the control construct
if dice <= 2 :
step = step - 1
elif dice > 2 and dice < 6 :
step= step + 1
else :
step = step + np.random.randint(1,7)
# Print out dice and step
print(dice)
print(step)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment