in reply to Dungeons and Dragons die roller (Golf)
Straightforward 39 bytes (37 + 2 flags) solution :
More complex 35 bytes solution :#!perl -pl /\d+\+/;$-+=rand$&for 1..$_;$_+=$'+$-
Due to the use of $', they can’t easily be ran from the command-line. Just store them in a file.#!perl -pl s/d/q(+~~rand($')+d)x$`/e;$_=eval
In Section
Obfuscated Code