Created
March 27, 2014 11:51
-
-
Save Leonidas-from-XIV/9805860 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| module Main where | |
| input = [ | |
| "4", "S", "a", "t", "z", "0", | |
| "3", "D", "a", "s", "17", | |
| "3", "e", "i", "n", "1", | |
| "3", "i", "s", "t", "12" | |
| ] | |
| traverse :: [String] -> Int -> [String] | |
| traverse [] _ = [] | |
| traverse _ 0 = [] | |
| traverse input n = word:(traverse input jmp) | |
| where len = (read (input !! (n-1))::Int) | |
| start = drop n input | |
| word = concat $ take len start | |
| (jump:_) = drop len start | |
| jmp = read jump::Int |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment