Skip to content

Instantly share code, notes, and snippets.

@GeorgiHristov42
Created October 8, 2014 23:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save GeorgiHristov42/407b84b5119549578119 to your computer and use it in GitHub Desktop.
Save GeorgiHristov42/407b84b5119549578119 to your computer and use it in GitHub Desktop.
rotate :: Int -> [Char] -> [Char]
rotate k list | k >= 0, k <= length list = drop k list ++ take k list
| otherwise = []
makeKey :: Int -> [(Char,Char)]
makeKey n = [let xs = "ABCDEFGHIJKLMNOPQRSTUVWXYZ", let ys = rotate n xs, (x,y) <- zip xs ys]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment