Skip to content

Instantly share code, notes, and snippets.

@iokasimov
Last active December 16, 2016 11:05
Show Gist options
  • Save iokasimov/732486f0fa9a2d9248253fdb342a521e to your computer and use it in GitHub Desktop.
Save iokasimov/732486f0fa9a2d9248253fdb342a521e to your computer and use it in GitHub Desktop.
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