Re: Parsing a Dice Roll String

new topic     » goto parent     » topic index » view thread      » older message » newer message

Pete Lomax wrote:
> 
> >   3d6+5 (roll 6-sided die 3 times, add 5 to sum)
> >   4d6-Lowest (roll 6-sided die 4 times, discard lowest die)
> >   4d6-Highest (roll 6-sided die 4 times, discard highest die)
> >   2d10*3-3d4 (roll 10-sided die twice, multiply by 3, then subtract
> >               the result of rolling a 4-sided die three times)
> >   5d12/10 (roll 12-sided die five times, divide result by 10)
> >
> would say the strings
> 	"d(6,3)+5"
> 	"d(6,4)-Lowest"
> 	"d(6,4)+Highest"
> 	"d(10,2)*3-d(4,3)"
> 	"d(12,5)/10"
> be acceptable?

All you'd have to do is take the expression and change any XdYs to
d(X,Y). Sounds reasonable.

-=ck
"Programming in a state of EUPHORIA."
http://www.cklester.com/euphoria/

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu