-
-
Save kgashok/ff4f7e06dacd30febf901efd820e58bf to your computer and use it in GitHub Desktop.
Fizz Buzz in elm
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
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Changes made from original to make it compile and run in http://elm-lang.org/try