Troy Denkinger > Games-FlipCoin > Games::FlipCoin

Download:
Games-FlipCoin-1.00.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
Report a bug
Module Version: 1.00   Source  

NAME ^

Games::FlipCoin - Simulates a coin flip

VERSION ^

Version 1.00

SYNOPSIS ^

 use Games::FlipCoin;

 $outcome = flip(); # A fair result
 $outcome = flip( bias => 0 ); # Also a fair result 
 $outcome = flip( bias => .05 ); # give a 5% bias to the 1 result
 $outcome = flip( bias => .99 ); # give a 99% bias to the 1 result
 $outcome = flip( bias => 1 );   # this coin only has a single result, 100% bias

DESCRIPTION ^

Games::FlipCoin is a simple library that simulates the flip of a coin and returns the outcome as either 0 or 1. The coin is normally unbiased. However, to simulate a biased coin, a bias factor can be passed to the flip() subroutine which will bias the coin toward the 1 result.

EXPORTS ^

 flip

FUNCTIONS ^

 flip( [bias => percentage of bias ] )

AUTHOR ^

Troy Denkinger, <tdenkinger at gmail.com>

BUGS ^

Please report any bugs or feature requests to bug-games-flipcoin at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Games-FlipCoin. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT ^

You can find documentation for this module with the perldoc command.

    perldoc Games::FlipCoin

You can also look for information at:

COPYRIGHT & LICENSE ^

Copyright 2006 Troy Denkinger, all rights reserved.

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