#!/usr/bin/env python3 # A simple dice rolling app # Written by xaphania 2022-04-19 # v0.1.our # modified for use with the our irc bot 2022-04-21 # yes this probably sucks. please send your flames to xaphania@tilde.town import random import sys try: dstring = sys.argv[1] except: dstring = "1d6" try: numDice = int(dstring.split("d",1)[0]) numFace = int(dstring.split("d",1)[1]) except: print(f"{dstring} is not a valid dice format") exit() diceList=[] while numDice>0: diceList.append(random.randint(1,numFace)) numDice-=1 total = sum(diceList) avg = total / len(diceList) high = max(diceList) low = min(diceList) print (f"Result: {diceList} | Total: {total} Average: {avg} Highest: {high} Lowest: {low}")