Last active
April 27, 2016 05:31
-
-
Save johnomarkid/10453c71f262addaef6365d07b6f0ae8 to your computer and use it in GitHub Desktop.
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
module CracklePop (..) where | |
import Graphics.Element exposing (show) | |
pattern : Int -> ( Int, Int ) | |
pattern n = | |
( n % 5, n % 3 ) | |
cracklePop : Int -> String | |
cracklePop n = | |
case pattern n of | |
( 0, 0 ) -> | |
"CracklePop" | |
( 0, _ ) -> | |
"Pop" | |
( _, 0 ) -> | |
"Crackle" | |
( _, _ ) -> | |
toString n | |
main : Graphics.Element.Element | |
main = | |
show (List.map cracklePop [1..100]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment