http://www.perlmonks.org?node_id=1174609


in reply to Dungeons and Dragons die roller (Golf)

To steal choroba's post:

echo 2d12+13 | \ perl -ple ' ($d,$s,$_)=split/[d+]/;map$_+=1+rand$s,1..$d ' 1 2 3 4 12345678901234567890123456789012345678901234

Replies are listed 'Best First'.
Re^2: Dungeons and Dragons die roller (Golf)
by Grimy (Pilgrim) on Oct 25, 2016 at 16:07 UTC
    This always prints 13, which is not a possible result for 2d12+13.