Skip to content

Instantly share code, notes, and snippets.

View tcql's full-sized avatar
💭
juice is fruit milk

Tim Channell tcql

💭
juice is fruit milk
  • Washington, DC
View GitHub Profile
@tcql
tcql / fizzbuzz1.hs
Created January 26, 2012 02:56
the Fizz Buzz problem, solved in Haskell
import Control.Monad (mapM_)
fizzbuzz = [0..100] >>= \x -> return (
case (x `mod` 3, x `mod` 5) of
(0,0) -> "FizzBuzz";
(0,_) -> "Fizz";
(_,0) -> "Buzz";
(_,_) -> show x)
main = mapM_ putStrLn fizzbuzz