Skip to content

Instantly share code, notes, and snippets.

@MiyamonY
Created February 27, 2015 11:13
Show Gist options
  • Save MiyamonY/2c2c0c2287d069c9677c to your computer and use it in GitHub Desktop.
Save MiyamonY/2c2c0c2287d069c9677c to your computer and use it in GitHub Desktop.
import System.Random
threeCoins :: StdGen -> (Bool, Bool, Bool)
threeCoins gen =
let (firstCoin, newGen) = random gen
(secondCoin, newGen') = random newGen
(thirdCoin, _) = random newGen'
in (firstCoin, secondCoin, thirdCoin)
-- threeCoins (mkStdGen 100)
-- (True,False,False)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment