User guide All lessons Cookbook Function reference Open playground

Ordered outcome labels

At the table

Some games speak in named bands (failure, success, critical) instead of a raw total. You still want exact probabilities—and sometimes “success or better” on that ladder.

Try it

In the playground, open this lesson in the playground and click Run (or press Shift+Enter).

The script

Scale = (
    scale()
    .step("CRITICAL_FAIL", ..5)
    .step("FAIL", 6..10)
    .step("SUCCESS", 11..15)
    .step("CRITICAL_SUCCESS", 16..)
)
roll = 1d20
out = roll.bucket(Scale)
output("check", out)
output("p_success_plus", out.p_at_least("SUCCESS"))

check · Outcomes

outcome%fracX/36
CRITICAL_FAIL25.01/49
FAIL25.01/49
SUCCESS25.01/49
CRITICAL_SUCCESS25.01/49

p_success_plus · Prob

outcome%fracX/36
p_success_plus50.01/218