
Games::Die - it's a die; you can roll it!

version 0.999_01
$Id: Die.pm 1501 2007-07-29 19:50:56Z rjbs $

$six_sided = Games::Die->new({ sides => 6 });
$twenty_sided = Games::Die->new(20);
$twenty_sided->sides; # 20
$total = $six_sided->roll + $twenty_sided->roll;

Games::Die provides an object-oriented implementation of a die that can be rolled.

my $die = Games::Die->new(\%arg); my $die = Games::Die->new($sides);
This method creates and returns a new Die. The number of sides must be an integer greater than zero. Passing $sides as the first argument is equivalent to giving that value as the sides argument, and nothing else.
Other parameters will probably appear only in subclasses of Games::Die.
This method returns the number of sides on this die.
my $result = $die->roll;
This method rolls the die and returns a Games::Die::Result object.
This method returns the class to be used for results.

Ricardo SIGNES <rjbs@cpan.org>

Copyright (C) 2005, Ricardo SIGNES.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.