import random
from MyDice import MyDice

# According to the rules in the 5e D&D Players Handbook, stats are generated by rolling 4 6-sided dice
# The lowest dice is discarded and the remaining dice are added to provide the value of that stat
def statroll():
    dice = MyDice()
    stats = dice.multidice(4,6)
    stats.remove(min(stats))
    return sum(stats)

def RollChar():
    stats = ["Strength", "Dexterity", "Constitution", "Intelligence", "Wisdom", "Charisma"]
    char = {}
    for i in range(len(stats)):
        char[stats[i]] = statroll()
    return char

# To determine an ability modifier subtract 10 from the ability score and then divide the total by 2 (round down).
def CalcMod(char):
    modifier = {}
    for c in char:
        modifier[c] = int((int(char[c]) -10) / 2)
    return modifier

def PrintStats(char):
    for (k,v) in char.items():
        print k, v


if __name__ == "__main__":
    name = raw_input("What is your name, Adventurer?")
    char = RollChar()
    print "Hello,", name, "here are your stats:"
    PrintStats(char)






