roll - Command line interface for dice rolls
version 0.046
# Evaluate these command line params roll 3d6 2d8 echo "5d6" > f echo "2d4+1" >> f # Read the contents of 'f' from STDIN roll < f # Evaluate 1d100 and open file 'f' roll d% f
This is a command line interface to the Games::Dice library. It takes die rolling specifications in the form of adb[+-*/b]c.
(This specification may change a bit over time, but not radically.)
a is optional and defaults to 1; this is number of dice to roll.
b is the number of sides on each die. '%' is shorthand for 100.
The optional end modifies the sum of the rolls. 'b' means take the "best" c rolls and sum them. Also '/' truncates the result to an integer after division.
Dice specifications can be piped in, given on STDIN or as positional parameters from the command line.
If a positional parameter matches a file name, it will be opened and each line of the file evaluated.
This module should work on any version of perl still receiving updates from the Perl 5 Porters. This means it should work on any version of perl released in the last two to three years. (That is, if the most recently released version is v5.40, then this module should work on both v5.40 and v5.38.)
Although it may work on older versions of perl, no guarantee is made that the minimum required version will not be increased. The version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl.
Philip Newton <pne@cpan.org>
Ricardo Signes <cpan@semiotic.systems>
This software is Copyright (c) 1999 by Philip Newton.
This is free software, licensed under:
The MIT (X11) License
To install Games::Dice, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Games::Dice
CPAN shell
perl -MCPAN -e shell install Games::Dice
For more information on module installation, please visit the detailed CPAN module installation guide.