Acme-Dice

 view release on metacpan or  search on metacpan

lib/Acme/Dice.pm  view on Meta::CPAN


=item bias

This is an integer between 0 and 100 that determines how much "weight" to
place on the favored side. A value of C<20> says to increase the chance of
rolling the favored number by 20%. A value of C<100> would mean to always
roll the favored number. A value of 0 will disable favoring completely,
even if a value for C<favor> is given. Default: 0

An exception will be thrown if the value is less than 0 or greater than 100.

=back

=head2 roll_craps

This function is sugar for C<roll_dice> that automatically rolls two 6-sided
dice. It will also automatically adjust the C<favor> parameter for "3" and "4"
as appropriate if a value for C<bias> is given, simulating "loaded" dice.

Like C<roll_dice>, the return value depends upon context.

  my $total = roll_craps( bias => 30 );
  my @dice = roll_craps( bias => 30 );

It will only accept a single, optional parameter: C<bias>

The C<bias> parameter behaves the same as described above for C<roll_dice>.
Any other parameters, including those that are otherwise legal for
C<roll_dice>, will cause an exception to be thrown.

The default is an un-biased roll of two 6-sided dice.

=head1 BUGS

Bugs? In an Acme module?!? Yeah, right.

=head1 SUPPORT

Support is provided by the author. Please report bugs or make feature requests
to the author or use the GitHub repository:

http://github.com/boftx/Acme-Dice

=head1 AUTHOR

Jim Bacon <jim@nortx.com>

=head1 COPYRIGHT

This program is free software; you can redistribute it and/or modify it under
the same terms as Perl itself. The full text of the license can be found in
the LICENSE file included with this module.

=head1 DISCLAIMER

Finding a way to use this module, and the consequences of doing so, is the
sole responsibility of the user!

=head1 NOTE

Acme employs the finest technology available to ensure the quality of its
products. There are no user-servicable parts inside. For your own safety,
DO NOT EXAMINE THE CONTENTS OF THIS PACKAGE!

=cut



( run in 0.592 second using v1.01-cache-2.11-cpan-5735350b133 )