1 Matching Annotations
  1. Feb 2019
    1. Haskell

      Haskell, Keep it simple, stupid.

      -- FizzBuzz
      module Main where
      
      import Control.Monad
      
      main :: IO ()
      main = forM_ [1..100] $ \n -> putStrLn . concat . take 2 $
          ["Fizz" | n `mod` 3 == 0] ++ 
          ["Buzz" | n `mod` 5 == 0] ++ 
          ["", show n]