Skip to content

Instantly share code, notes, and snippets.

@Spebby
Last active November 21, 2022 19:41
Show Gist options
  • Save Spebby/d8b69f0c60115fea6f971b29d6749e29 to your computer and use it in GitHub Desktop.
Save Spebby/d8b69f0c60115fea6f971b29d6749e29 to your computer and use it in GitHub Desktop.
rolls until jailed.
#!/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