Skip to content

Instantly share code, notes, and snippets.

@zfogg
Last active August 29, 2015 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zfogg/e12f4b02947af0a75047 to your computer and use it in GitHub Desktop.
Save zfogg/e12f4b02947af0a75047 to your computer and use it in GitHub Desktop.
overly-complex fizzbuzz
mergeWords = zipWith (\x -> (++) x . (++) " ")
fizzs = tail . repeat $ "Fizz" : replicate 4 ""
buzzs = tail . repeat $ "Buzz" : replicate 2 ""
fizzBuzzs = tail . repeat $ "FizzBuzz" : replicate 14 ""
numbers = map ((:[]) . show) [0..]
main = mapM_ putStrLn $ tail $
map (last . words) . foldl1 mergeWords $
map (concat . take 101) [numbers, fizzs, buzzs, fizzBuzzs]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment