Failed to commit Dice changes in earlier commit
This commit is contained in:
parent
0fc770f261
commit
07e2ef3ab2
4
dice.py
4
dice.py
|
@ -17,7 +17,7 @@ class Dice():
|
||||||
# All of the dark regex magic is contained to this function,
|
# All of the dark regex magic is contained to this function,
|
||||||
# lest it corrupt innocent code
|
# lest it corrupt innocent code
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_desc(cls, desc):
|
def from_str(cls, desc):
|
||||||
if not re.match(r'^\d+d\d+', desc):
|
if not re.match(r'^\d+d\d+', desc):
|
||||||
raise Exception('Dice format invalid. See --help')
|
raise Exception('Dice format invalid. See --help')
|
||||||
|
|
||||||
|
@ -139,7 +139,7 @@ class Dice():
|
||||||
def parse_input(args):
|
def parse_input(args):
|
||||||
dice_list = []
|
dice_list = []
|
||||||
for arg in args:
|
for arg in args:
|
||||||
dice_list.append(Dice.from_desc(arg))
|
dice_list.append(Dice.from_str(arg))
|
||||||
|
|
||||||
return dice_list
|
return dice_list
|
||||||
|
|
||||||
|
|
12
readme.mk
12
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.
|
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
|
### battleman.py
|
||||||
A battle manager - keeps track of initiative order, hit points, and conditions for everyone involved in the battle.
|
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
|
### 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.
|
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.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user