NAME

Games::Die::Dice - more than one die

DESCRIPTION

Games::Die::Dice provides a union of any number of Games::Die objects.

VERSION

version 0.07_01

$Id: Dice.pm,v 1.5 2004/10/19 03:52:28 rjbs Exp $

SYNOPSIS

$four_eight_ten = new Games::Die::Dice(4, 8, 10);
$pair_of_eights = new Games::Die::Dice('2d8');

$result = $four_eight_ten->roll() + $pair_of_eights->roll();

METHODS

new

Creates a new set of Dice. Takes a list containing the number of sides of each die in the set, or a single "Dungeons and Dragons"-style specification such as "2d8" or "6d20+2". The d may be upper- or lower-case, and the modifier may be a positive or negative integer.

dice

This returns a list of the Games::Die objects in the set.

roll

Rolls each die in the set. In scalar context, returns the sum. In list context, returns the list of values that came up on each die (and also the adjust value if specified).

AUTHORS

Andrew Burke <burke@bitflood.org>

Jeremy Muhlich <jmuhlich@bitflood.org>

Ricardo SIGNES <rjbs@cpan.org>

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.