Created
June 29, 2011 15:18
-
-
Save keichi/1054062 to your computer and use it in GitHub Desktop.
FizzBuzz without using Mod, Mul, Div
This file contains 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
import Control.Monad | |
fizz = concat $ repeat ["", "", "Fizz"] | |
buzz = concat $ repeat ["", "", "", "", "Buzz"] | |
fizzbuzz = zipWith (++) fizz buzz | |
combine num "" = show num | |
combine _ str = str | |
main = forM_ (take 100 $ zipWith combine [1 ..] fizzbuzz) putStrLn |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment