Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Dungeons and Dragons die roller (Golf)

by Tanktalus (Canon)
on Oct 24, 2016 at 17:25 UTC ( #1174609=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1174609]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2017-12-16 11:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (450 votes). Check out past polls.

    Notices?