Dotfiles, utilities, and other apparatus.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

28 lines
445 B

#!/usr/bin/env perl
# roll some dice
use utf8;
use open ':std', ':encoding(UTF-8)';
use strict;
use warnings;
use 5.12.0;
use Scalar::Util;
my $count = 1;
if (defined $ARGV[0] && Scalar::Util::looks_like_number($ARGV[0])) {
$count = $ARGV[0];
}
my $sum = 0;
my @faces = ('⚀', '⚁', '⚂', '⚃', '⚄', '⚅');
for (1..$count) {
my $face = int(rand @faces);
$sum += ($face + 1);
print $faces[$face] . " ";
}
print "($sum)\n";