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
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Dungeons and Dragons die roller (Golf)
by Anonymous Monk on Nov 04, 2016 at 18:51 UTC | |
by tybalt89 (Monsignor) on Nov 05, 2016 at 02:30 UTC | |
by Anonymous Monk on Nov 07, 2016 at 17:00 UTC | |
by tybalt89 (Monsignor) on Nov 07, 2016 at 19:17 UTC | |
by Anonymous Monk on Nov 07, 2016 at 20:11 UTC |
In Section
Obfuscated Code