Platinum Partner

Dice Roller

Given a di(c)e roll in standard d20 format on the command line, this script will roll the dice & output the result.

#!/usr/bin/perl -wl
use strict;
$_ = shift or die 'Invalid argument passed';
s/\s+//g;
/^(\d+)[dD](\d+)([+-]\d+)?$/ or die 'Invalid argument passed';
my $sum = 0;
$sum += 1 + int rand $2 for 1..$1;
$sum += $3 if defined $3;
print $sum;
{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks
Tweet

{{parent.nComments}}