Hacker News new | past | comments | ask | show | jobs | submit login

It took me a while to figure out why mine wasn't working because I wrote [1..100], which is a one-element array with a range in it. Too much Haskell, I guess.

To salvage my dignity, here's the Haskell solution:

    main = mapM_ putStrLn $ map fizzbuzz [1..100]
        where fizzbuzz n | n `mod` 15 == 0 = "FizzBuzz"
                         | n `mod` 3  == 0 = "Fizz"
                         | n `mod` 5  == 0 = "Buzz"
                         | otherwise       = show n



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: