Last active
December 16, 2016 11:05
-
-
Save iokasimov/732486f0fa9a2d9248253fdb342a521e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import System.Random | |
type Person = String | |
type Party = [(Person,Person)] | |
people = ["Sergey", "Eugeny", "Georgy", "Vsevolod", "Daniil", "Murat"] | |
rshift :: IO Int | |
rshift = randomRIO (1::Int, (length people) - 2) | |
bias :: [Person] -> Int -> [Person] | |
bias people i = (drop i people) ++ (take i people) | |
organize :: [Person] -> [Person] -> Party | |
organize whos whoms = zip whos whoms | |
main = rshift >>= \i -> print $ organize people (bias people i) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment