Skip to content
Produce a fair coin flip from a biased coin
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE
README.md
fairflip.py

README.md

FairFlip

Get a fair coin flip result from a biased coin

Dependencies:

  • Python >= 2

Usage:

Usage python3 fairflip.py <heads_percent>

heads_percent is the chance of HEADS happening from a single coin flip
(The heads bias).  heads_percent is a whole number from 1 and 99.

Examples:
  python3 fairflip.py 60
  python3 fairflip.py 10
  python3 fairflip.py 50

Warning:

There is no error handling, so an error/exception may pop up if values are unexpected

You can’t perform that action at this time.