Skip to content

Instantly share code, notes, and snippets.

@Newlifer
Created May 22, 2014 14:41
Show Gist options
  • Save Newlifer/d9f0b95b18baa5712727 to your computer and use it in GitHub Desktop.
Save Newlifer/d9f0b95b18baa5712727 to your computer and use it in GitHub Desktop.
import System.Random
randInRange :: Int -> Int -> IO Int
randInRange a b = getStdRandom $ randomR (a, b)
ep :: Int -> IO Int
ep s = if s /= 3 then randInRange 1 26 else randInRange 1 13
main =
do
x <- randInRange 1 4
res <- ep x
print x
print res
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment