Multiple rolls and comments

Repeat one formula independently and label the result.

Repetition with

N#formula runs N independent executions of the same formula. The root total sums their totals; result.rolls preserves each one. N may be a deterministic math expression such as (3-1)#d20, provided it resolves to a positive integer within maxRolls. The compiler rejects zero rolls.

2#4d6kh3
(3-1)#d20+5
ceil(3/2)#1d6

Comments and labels

[text], // text, /* text */, and # text (when no repeat prefix is present) add a description. Normalization removes comments from the executable formula and joins their text in result.comment. The repetition marker takes precedence when # follows a valid leading count.

d20+5 [attack]
1d20 # initiative
2#d6 // two attacks

To run different formulas together, use mixed batches separated by ;. + remains arithmetic within a formula.

Try the examples

Try 2#4d6kh3 · Try (3-1)#d20+5 · Try d20+5 [ataque]