
Games::FlipCoin - Simulates a coin flip

Version 1.00

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

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.

flip

flip( [bias => percentage of bias ] )

Troy Denkinger, <tdenkinger at gmail.com>

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.

You can find documentation for this module with the perldoc command.
perldoc Games::FlipCoin
You can also look for information at:

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.