Created
August 28, 2014 20:57
-
-
Save ololobus/46f4798dc5b931f395db to your computer and use it in GitHub Desktop.
CracklePop program
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
hundred = [1..100] | |
crack n | |
| mod n 5 == 0 && mod n 3 == 0 = "CracklePop" | |
| mod n 3 == 0 = "Crackle" | |
| mod n 5 == 0 = "Pop" | |
| otherwise = show n | |
main = print (map crack hundred) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment