💾 Archived View for tilde.club › ~zerodni › dnddiceroller.gmi captured on 2022-07-16 at 13:56:54. Gemini links have been rewritten to link to archived content

View Raw

More Information

➡️ Next capture (2023-01-29)

-=-=-=-=-=-=-

                                                                       _/          
    _/_/_/_/_/  _/_/_/_/  _/_/_/      _/_/    _/_/_/    _/      _/  _/    _/_/_/   
         _/    _/        _/    _/  _/    _/  _/    _/  _/_/    _/          _/      
      _/      _/_/_/    _/_/_/    _/    _/  _/    _/  _/  _/  _/          _/       
   _/        _/        _/    _/  _/    _/  _/    _/  _/    _/_/          _/        
_/_/_/_/_/  _/_/_/_/  _/    _/    _/_/    _/_/_/    _/      _/        _/_/_/       
=================================================================================

Crappy DND Stat roller that i use. My group reqires all stats should not be below 70. So it rerolls till its above 70.

#!/usr/bin/python3
from sys import argv
# import random for dice roles
import random
# import only system from os
from os import system, name

# Define Dice Target if nothing is specified then the target will be 70
dicetarget = argv[1] if len(argv) >= 2 else '70'


# Rolling the Dice
def dice_function():
    my_random = []
    for i in range(4):
        my_random.append(random.randrange(1, 6, 1))
    my_random.remove(min(my_random))
    dicesum = sum(my_random)
    print(f"{my_random} = {dicesum}")
    return dicesum


# Printing all Dice Rolls
def main():
    print("Dice Rolls")
    print("---------------------------------------")
    diceresult = []
    for i in range(6):
        diceresult.append(dice_function())
        attributecheck = sum(diceresult)
    print(f"{diceresult} = {attributecheck}")
    return attributecheck


# Define our clear function
def clear():
    # for windows
    if name == 'nt':
        _ = system('cls')
    # for mac and linux(here, os.name is 'posix')
    else:
        _ = system('clear')


# While total value of dice roles is below target value keep rolling
while int(dicetarget) > int(main()):
    main()
    clear()
print("Here are your Dice!")

Back to Main Page