Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@otaks
Created April 30, 2016 22:05
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 otaks/067902cbbe74a2352116fd2179f738fb to your computer and use it in GitHub Desktop.
Save otaks/067902cbbe74a2352116fd2179f738fb to your computer and use it in GitHub Desktop.
fizzbuzz
enable3div x = x `mod` 3 == 0
enable5div x = x `mod` 5 == 0
fizzbuzz x = if ( enable3div x ) && ( enable5div x )
then "Fizz Buzz"
else if ( enable3div x )
then "Fizz"
else if ( enable5div x )
then "Buzz"
else
show x
main =
-- map(putStrLn (map say [1..20]))
print (map fizzbuzz [1..20])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment