Created
April 20, 2018 13:12
-
-
Save JakubTesarek/2580ae3137d321307636874677b85917 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import random | |
def roll2d6(): | |
res = random.randint(1, 6) + random.randint(1, 6) | |
while res <= 2 and random.randint(1, 6) <= 3: | |
res -= 1 | |
while res >= 12 and random.randint(1, 6) >= 4: | |
res += 1 | |
return res |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment