Random::SpecialDice rolls a random die, d16, percentile, permille, or permyriad.
This document describes Random::SpecialDice version 1.0.
use Random::SpecialDice qw(random_die percentile permille permyriad d16);
my $die = random_die; # returns a die (1d4, 1d6, 1d8, 1d10, 1d12, 1d20)
my $rolled_die = random_die(1); # rolls the random die and returns the result
my $percent = percentile; # rolls a percentile using d10s
my $permille = permille; # rolls a permille using d10s
my $permyriad = permyriad; # rolls a permyriad using d10s
Random::SpecialDice rolls a random die, d16, percentile, permille, or permyriad. The functions random_die
, d16
, percentile
, permille
, and permyriad
need to be imported into your script.
random_die();
If used without a parameter, random_die
returns a random dice by the number of sides (1d4, 1d6, 1d8, 1d10, 1d12, or 1d20).
random_die(1);
If used with a paramter, random_die
returns the result of the roll for the random dice. It will not tell you which die was rolled.
d16;
d16
was written to reproduce the die rolls required for a chart. It rolls a d6 first. If the result of the d6 is less than 4, it will roll a d8. If the result of the d6 is 4 or greater, it will roll a d8 and add 8.
percentile;
percentile
is the result for rolling 2 d10s and combining the results to generate a number between 1 and 100. The value of the first d10 is the first digit, and the value of the second d10 is the second digit. Should the results of both rolls be 10, the result will be 100.
permille;
permille
is the result for rolling 3 d10s and combining the results to generate a number between 1 and 1000. The value of the first d10 is the first digit, the value of the second d10 is the second digit, and the value of the third d10 is the third digit. Should the results of the three rolls be 10, the result will be 1000.
permyriad;
permyriad
is the result for rolling 4 d10s and combining the results to generate a number between 1 and 10000. The value of the first d10 is the first digit, the value of the second d10 is the second digit, the value of the third d10 is the third digit, and the value of the fourth d10 is the fourth digit. Should the results of the four rolls be 10, the result will be 10000.
Random::SpecialDice depends on Games::Dice and Exporter.
Lady Aleena with help from GrandFather on PerlMonks.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.
Copyright © 2020, Lady Aleena (aleena@cpan.org)
. All rights reserved.