Last active
November 21, 2022 19:41
-
-
Save Spebby/d8b69f0c60115fea6f971b29d6749e29 to your computer and use it in GitHub Desktop.
rolls until jailed.
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
#!/usr/bin/env python3 | |
"""Rolls dice and gives the output.""" | |
import random | |
warnings = 0 | |
LineNumber = 1 | |
# die consts | |
dieCode = "⚀⚁⚂⚃⚄⚅" | |
warningDict = ["", "⚠", "⚠ ⚠", "⚠ ⚠ ⚠"] | |
while warnings < 3: | |
diceVals = [random.randint(0, len(dieCode) - 1), random.randint(0, len(dieCode) - 1)] | |
if diceVals[0] == diceVals[1]: | |
warnings += 1 | |
else: | |
warnings = 0 | |
print(f"{LineNumber} {dieCode[diceVals[0]]} {dieCode[diceVals[1]]} {warningDict[warnings]}") | |
LineNumber += 1 | |
print("GO TO JAIL. GO DIRECTLY TO JAIL. DO NOT PASS GO. DO NOT COLLECT $200.") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment