diff --git a/dice.py b/dice.py index b02121a..f88cedc 100755 --- a/dice.py +++ b/dice.py @@ -17,7 +17,7 @@ class Dice(): # All of the dark regex magic is contained to this function, # lest it corrupt innocent code @classmethod - def from_desc(cls, desc): + def from_str(cls, desc): if not re.match(r'^\d+d\d+', desc): raise Exception('Dice format invalid. See --help') @@ -139,7 +139,7 @@ class Dice(): def parse_input(args): dice_list = [] for arg in args: - dice_list.append(Dice.from_desc(arg)) + dice_list.append(Dice.from_str(arg)) return dice_list diff --git a/readme.mk b/readme.mk index 5c36c6d..948920f 100644 --- a/readme.mk +++ b/readme.mk @@ -1,8 +1,10 @@ -## 4etools: D&D 4e command-line tools +# 4etools: D&D 4e command-line tools This is a collection of tools designed to assist a GM running a tabletop roleplaying game (either in person or over the Internet). Some of the tools are specific to D&D 4e, and some of them are more broadly useful. They are designed to minimize the amount of time the GM needs to spend looking at the screen, so that she can keep her focus on the game and the players. -4etools includes: +4etools includes tools for both GMs and programmers: + +## For users (GMs) ### battleman.py A battle manager - keeps track of initiative order, hit points, and conditions for everyone involved in the battle. @@ -12,3 +14,9 @@ Battleman also aas a sense of whose turn it is, and prints a convenient message ### dice.py A robust command-line dice-rolling utility. Many others exist, of course, but this one accepts all of its arguments as command-line parameters, making it a simple and intuitive interface. + + +## For programmers + +### dice.py +When treated as a library, provides a robust Dice class with a convenient from_str() classmethod.