Created
March 29, 2016 22:54
-
-
Save Qata/3ed757450f0cc01e039df5df941f3cdb to your computer and use it in GitHub Desktop.
This file contains hidden or 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, leftAligned, flow, down) | |
import List exposing (map, intersperse) | |
import Text exposing (fromString) | |
fizzBuzz : Int -> String | |
fizzBuzz n = | |
case (n % 3, n % 5) of | |
(0, 0) -> "FizzBuzz" | |
(0, _) -> "Fizz" | |
(_, 0) -> "Buzz" | |
_ -> toString n | |
main : Element | |
main = | |
map fizzBuzz [1..100] | |
|> map (fromString >> leftAligned) | |
|> flow down |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment