Skip to content

Instantly share code, notes, and snippets.

@kgashok
Forked from ctran/fizzbuzz.elm
Last active May 6, 2016 01:29
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 kgashok/ff4f7e06dacd30febf901efd820e58bf to your computer and use it in GitHub Desktop.
Save kgashok/ff4f7e06dacd30febf901efd820e58bf to your computer and use it in GitHub Desktop.
Fizz Buzz in elm
import Graphics.Element exposing (Element, flow, down, show)
import List exposing (map)
main : Element
main =
let fizzBuzz n = case (n % 3, n % 5) of
(0, 0) -> "FizzBuzz"
(0, _) -> "Fizz"
(_, 0) -> "Buzz"
_ -> toString n
in map fizzBuzz [1..100] |> map show |> flow down
@kgashok
Copy link
Author

kgashok commented May 6, 2016

Changes made from original to make it compile and run in http://elm-lang.org/try

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment