Created
April 30, 2016 22:05
-
-
Save otaks/067902cbbe74a2352116fd2179f738fb to your computer and use it in GitHub Desktop.
fizzbuzz
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
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