Created
October 19, 2018 21:45
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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