Python not that wierd

William Tanksley wtanksle at dolphin.openprojects.net
Thu Aug 3 15:36:29 EDT 2000


On Wed, 2 Aug 2000 18:43:19 +0200, Alex Martelli wrote:

>Well, there ARE cases where you want to roll and sum two different
>kind of dice, surely.  Even in bad old D&D first edition, in certain cases
>you had D8+D4, for example...

Once you start THAT there's no returning.

Fortunately, the algorithm is very simple:

Take the string containing the dice rolls, use regexp to generate a new
string which contains appropriate random numbers in place of the dice
rolls, and evaluate the string.

"sin(1d360)*30d6"

>Alex

-- 
-William "Billy" Tanksley



More information about the Python-list mailing list