[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [HOE] Dice Rolling Prog
> Hey, I've got one too! :)
And here's mine, in plain C
http://my.core.com/crawford/roll.c
Usage:
% roll
Usage: roll [-n reps] [-t|-d] [-q] <N>d<M>[+|-B]
N in {1, ..., 20}, M in {4, 6, 8, 10, 12}
B is option bonus (+) or penalty (-)
-q: quiet -t: trait check -d: damage roll
Its output looks like this
% roll 3d12+4
12 3 5
5
Result: 17+4 = 21
Or for a damage roll,
% roll -d 5d10
7 5 4 10 3
9
Result: 38
Lots of rolls, with just results:
% roll -q -n 10 4d6
Result: 5
Result: 10
Result: 8
Result: 5
Result: 5
Result: 5
Result: 5
Result: 4
Result: 5
Result: 10