Skip to content

Instantly share code, notes, and snippets.

@johnomarkid
Last active April 27, 2016 05:31
Show Gist options
  • Save johnomarkid/10453c71f262addaef6365d07b6f0ae8 to your computer and use it in GitHub Desktop.
Save johnomarkid/10453c71f262addaef6365d07b6f0ae8 to your computer and use it in GitHub Desktop.
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